- 提交代码
git add .
git commit -m “你的说明”
git push origin master(一般使用界面工具)
origin是远程主机,master表示你本地分支和远程有跟踪关系,分支名是可以修改的
- Pull 代码
git pull /git pull origin master (默认跟踪的服务器)(一般使用界面工具)
origin是远程主机,master表示你本地分支和远程有跟踪关系,分支名是可以修改的
- clone 代码
git clone http://网址
- 更新远程分支
git fetch origin
- 切换并且创建分支
git checkout -b pushdev origin/pushdev
- 切换分支
git checkout master
- 查看代码状态
git status
- 查看总分支以及目前分支
git branch -a
- 查看提交代码状况
git log
- 回退代码
git log
git reset --hard c88173be7b521fcbe88c5be4fc1d3889e52226ae