1、git切分支指令:
1) cd ~/XXX/
2) git fetch
3) git checkout br_XXX
【注意】:有些分支可能需要具体到指定目录
2、git回退
git reset HEAD~1
3、将多次提交合并
git log
git reset HEAD~3
git status
git add .
git status
补增提交:
git commit --amend
git log
4、如果仓库更新执行:repo sync -c --no-update-manifest 报错,错误描述如下:
error: XXX: branch br_XXX is published (but not merged) and is now 3 commits behind
执行:
git stash 将文件给push到一个临时空间中 (如果有涉及过个仓,多个仓都需要操作)
repo sync -c 仓库更新
git stash pop 将文件从临时空间pop下来
5、如果想更新仓库,去除冲突,执行:
git reset --hard
git clean -xdf
git status
repo sync -c 代替:git pull
在此基础上进行代码的提交
6、git log -p
查看具体的提交
7、单个文件更新指令
git checkout filename
8、提交
git commit
repo upload .