上传代码流程
cd wenjiannei
git status
git add xx.py
git commit -m "zhushi"
git push origin server-distract
1、clone
git clone xxxxx.git
clone非master分支的代码:
git branch -r #查看远程分支
git branch -a #查看所有分支
git branch -a 所有分支名:
origin/HEAD -> origin/master
origin/develop
origin/master
使用checkout命令切换分支:
git checkout origin/develop
2、比较两个分支文件异同
git diff branch1 branch2 --stat
git diff 更多用法:
https://www.jianshu.com/p/80542dc3164e
https://www.yiibai.com/git/git_diff.html
3、git branch查看及创建分支
查看分支
git branch #查看当前、本地分支
git branch -r #查看远程分支
git branch -a #查看所有分支
创建分支
git branch gaze #创建gaze分支
修改分支名字
git branch -m gaze gaze05
3、git checkout
切换分支
git checkout origin/gaze
创建新分支并切换 branch+checkout
git checkout -b branchName
4、将更改添加到某一(新)分支上
git status、git add、 git commit 、git push
git status
git add config.pbtxt
git commit config.pbtxt -m "commit a gaze file:config.pbtxt"
git push origin gaze
复杂使用
# Git commit-id
git checkout commit-id
https://www.jianshu.com/p/036f2c818cb2