git操作笔记,初级使用教程请参考 git cheatsheet 。
git add .git rm .git commit -m "first commit"git pushgit branchgit branch -agit checkout -b devgit pull origin gh-pages:gh-pages需要本地没有gh-pages分支,否则会提示已拒绝
git branch --set-upstream-to=gh-pages
git push origin gh-pages如何修改一个commit:
- 先在一个干净的repo里面把这一个commit 拉取下来:
git fetch ssh://xxx@xxxx/xxx/xxx refs/changes/20/190820/6 && cherry-pick FETCH_HEAD具体指令需要看gerrit网页右上角:
此时git status 当前是有y一个commit的,git log也能看到log。
- 修改代码,然后提交到本地。
git add
#使用 --amend 重新更新这个commit信息。
git commit --amend- push到gerrit
需要指定具体push到哪个id
git push origin HEAD:refs/changes/<change id>Gitlab 官方提供的 git cheatsheet 。

