1. 下载代码
repo init
repo sync
2. 创建分支
repo start branch --all
3. porting作业:
cd git dir
repo sync . //get all branchs
git cherry-pick commit-id
if no conflit
done
else // has confilt
deal with confilt
git add/rm
if ok
git cherry-pick --continue
done
else //nok ok
git cherry-pick --abort
retry
4. 查看/生成/合入patch
git format-patch commit-id // get all patches base commit-id
git show commit-id //get all information patch of commit-id
git log -u //get all information of git log
git am patch //apply patch with commit message
git apply patch
5. 修改上次提交
git add
git commit --amend
git commit --amend --author='Name <E-mail>' //修改作者
6. 查看本地分支与远程分支对应关系
git branch -a //查看本地和远程所有分支
git branch -vv //查看本地分支对应远程分支
git branch --set-upstream-to=origin/[remote-branch] //切换本地分支对应的远程分支
7. revert已存在提交
git revert [commit-id]