Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Git: pulling colleague's feature branch

Git beginner here. My colleague is going on holiday and I’ve to pick up (and finish and merge to master) his work in his absence. He has his feature branch (call it his_branch) with all his work. He cannot merge it to master as the changes are not complete yet and will break stuff in current form.

What will be the git workflow for this? How exactly can I get his changes? I want my branch to have his changes but then I want to commit everything to master, so slightly confused.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can get the changes from his branch with git-cherry-pick that applies the changes introduced by some existing commits.

You can check the commit number from his branch and then use the following in terminal:

  • git checkout your_branch_name (move to your branch)
  • git cherry-pick his_commit_number (something like 608bf269ce1002e18f8400b5cc5aff – to add his changes)
  • git push (to push his changes in your branch)

You can create the PR from your branch in master when the work is done.

Or you can work and add more commits directly to his branch.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading