-
Notifications
You must be signed in to change notification settings - Fork 43
git & repo cmd
David edited this page Jan 14, 2015
·
8 revisions
- ./repo init -u ssh://mypc@192.168.7.32:29418/OTT/M3/manifests -b master
- ./repo sync
- ./repo forall -c git stash
- ./repo forall -c git stash clear
git branch -r -d orgin/xxx
git push origin :xxx
想在的项目组里同步一下,结果发现git pull和git fetch都不能删除remite/origin/xxx。(具体表现是branch -a还显示有远程xxx分支)。后来找了一下资源,再git fetch --help发现有一个参数'-p'可以解决这个问题。
最后:git fetch -p。搞定。
- git reset --hard sha1-commit-id
- git push origin HEAD --force //need the 'force push' permission
- git reflog / git revert
- http://stackoverflow.com/questions/1338728/delete-commits-from-a-branch-in-git
- http://git-scm.com/docs/git-clean
- http://stackoverflow.com/questions/61212/how-do-i-remove-local-untracked-files-from-my-current-git-branch
git add .
git commit –amend
or
git reset HEAD^
#重新修改
git add .
git commit -m “MSG”
如果email不对,会无法提交到Gerrit,所以这个命令也可能用到。
git commit –amend –author=<user-email>
Just build something.