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 post 🙂 So let’s see how we do it from the very beginning.

1. Clone your forked project:

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

2. Add remote that will point to the original repository

git remote add new https://github.com/<original_repo_projet>/Dummy.git

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

git checkout -b new new/master

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

git cherry-pick <hash_of_specific_commit>

5. Send the pull request! 😀

git push origin new

You should see similar outout to:

Counting objects: 11, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 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 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s