Git — How to merge a file from another branch

Everyone knows how to merge a branch using Git. Take it a step further and squash the commits upon merging.

The question was recently on how to cherry pick a file from another branch or a commit from another branch generic viagra australia reviews. This was a very interesting scenario that has a high chance of happening during software development. I wanted to find a easy way to accomplish this.

Here is the suggested method:

git checkout featureBranch filename


git checkout 9e402a458 filename

Both of these methods will fetch a snapshot of the file from the branch head or the commit.

This entry was posted in Git. Bookmark the permalink.

Leave a Reply