一.Git全局设置
1.设置用户信息
git config --global user.name "xxx"
git config --global user.email "xxxx@xx.com "
2.查看配置信息
git config --list
3.获取Git仓库
本地初始化仓库:git init
从远程仓库克隆:git clone [远程Git仓库地址]
二.本地仓库操作命令
1.git status 查看文件状态
2.git add 将文件的修改加入暂存区
3.git reset 将暂存区的文件取消暂存或者是切换指定版本
4.git commit 将暂存区的文件修改提交到版本库
5.git log 查看日志
三.远程仓库操作命令
1.git remote 查看远程仓库
2.git remote add 添加远程仓库
3.git clone 从远程仓库克隆
4.git pull 从远程仓库拉取
5.git push 推送到远程仓库
四.分支操作命令
1.git branch 查看分支
git branch 列出本地所有分支
git branch -r 列出所有远程分支
git branch -a 列出所有本地分支和远程分支