神刀安全网

GIT: Pull request for specific commit

One of the common questions I get from new Github users is: “How to send pull request for one commit?”

Common questions are  great chance for a new postSo let’s see how we do it from the very beginning.

1. Clone your forked project:

gitclone https://github.com/<your_username>/Dummy.git cd Dummy 

2. Add remote that will point to the original repository

gitremoteaddnew https://github.com/<original_repo_projet>/Dummy.git 

3. Create new branch that will track the original master branch

gitcheckout -b new new/master 

4. Now cherry-pick the one specific commit you would like to send as pull request

gitcherry-pick <hash_of_specific_commit> 

5. Send the pull request! :grinning:

gitpushoriginnew 

You should see similar outout to:

Countingobjects: 11, done. Delta compressionusingupto 8 threads. Compressingobjects: 100% (9/9), done. Writingobjects: 100% (11/11), 1.91 KiB | 0 bytes/s, done. Total 11 (delta 2), reused 8 (delta 0) To https://github.com/<your_username>/Dummy.git 

Now you can go to “new” branch and pull request a specific commit

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » GIT: Pull request for specific commit

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮