I\'m using Git on a new project that has two parallel -- but currently experimental -- development branches:
master
: import of existing codebase pl
1800 INFORMATION's answer is completely correct. As someone new to Git, though, "use git cherry-pick" wasn't enough for me to figure this out without a bit more digging on the Internet, so I thought I'd post a more detailed guide in case anyone else is in a similar boat.
My use case was wanting to selectively pull changes from someone else's GitHub branch into my own. If you already have a local branch with the changes, you only need to do steps 2 and 5-7.
Create (if not created) a local branch with the changes you want to bring in.
$ git branch mybranch
Switch into it.
$ git checkout mybranch
Pull down the changes you want from the other person's account. If you haven't already, you'll want to add them as a remote.
$ git remote add repos-w-changes
Pull down everything from their branch.
$ git pull repos-w-changes branch-i-want
View the commit logs to see which changes you want:
$ git log
Switch back to the branch you want to pull the changes into.
$ git checkout originalbranch
Cherry pick your commits, one by one, with the hashes.
$ git cherry-pick -x hash-of-commit