Q: How to quickly undo the changes in the repo?
A:
git reset --hard master@{"10 minutes ago"}
git push -f origin master
Q: How to contribute to open source project?
A: Pull Request
Q: How to do a pull request?
A:
1. fork the repo.
2. git clone a.git
3. git remote add upstream a.git
4. git checkout -b branchname
5. coding
6. git add . && git commit -m “change”
7. git push origin branchname
8. start a pull request in github
Q: How to squash some commits into one commit?
A: git rebase -i SHA-1
Q: What if we start a pull request from master but we want to do another pr before the previous pr is merged?
A:
git checkout master
git pull --rebase upstream master
git checkout -b newbranch
coding
git push origin newbranch
git checkout master
git reset --hard
git push -f origin master
原文:http://www.cnblogs.com/yuchi1989/p/6389295.html