Wednesday, September 12, 2012

Git: How to commit only one file from another branch

Problem claimed as title: How to commit only one file from another branch, (instead of the whole branch)

git checkout <branch-name> <path-to-file>

example: (here, we want to only merge the .gitignore file from desired-branch into current HEAD branch.)

git checkout desired-branch .gitignore


This answer is referred to the following url:
http://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch/

No comments:

Post a Comment

prettify