首页 > 其他 > 详细

Q&A about git

时间:2017-02-11 17:04:02      阅读:226      评论:0      收藏:0      [点我收藏+]

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

     

 

Q&A about git

原文:http://www.cnblogs.com/yuchi1989/p/6389295.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!