Brandon Gallas
Brandon Gallas

Reputation: 21

How do I pull a specific version of a branch to the master?

This question pertains to my workflow using github. My colleague sent me a pull request and kept advancing the branch he was working in with new commits? I want to pull the commits related to the pull request, but the pull request now has the commits too. I searched for solutions and kept being led to the "rebase" command. Regrettably, that command is too complicated for me, plus I use tortoiseSVN as my interface to github. I had some solutions using revert, but they were all un-elegant and there had to be something easy. Also the last time I tried a revert, I had some conflicts with commits that no longer existed because of the revert.

Upvotes: 1

Views: 65

Answers (1)

Brandon Gallas
Brandon Gallas

Reputation: 21

My colleague got a response from a github "ask a human". I am reporting the solution here to help other users.

  1. Navigate to the branch with the work to be pulled.
  2. Navigate to the commit history for the branch and identify the point in that history that you want to pull into the master.
  3. Click on the button on the right marked "<>" == "Browse the repository at this point in the history".
  4. Click on the branch pull down menu and create a new branch. This will create a new branch at that point in the history that you want to pull into the master.
  5. Create and execute a pull request to merge that branch into the master.

Too easy. I don't understand how I didn't run across an example of this workflow. I hope I save someone else the time and headaches that I spent.

Upvotes: 1

Related Questions