git: Get a single file from another repository

By admin

This is so easy it's almost stupid. Let's say want to copy a single file from b0 to another branch, b1, without doing a merge and all that crap. all you do is this:

# change to b1
get-checkout b1
# checkout the single file
git-checkout b0 path/to/file

Then you can do something like to see the differences:

git-diff HEAD path/to/file

and when you are done:

git-commit -m “Commit it, baby” path/to/file

“Commit it, baby” as a comment is mandatory.



categoriaTech commentoNo Comments dataSeptember 25th, 2008

About... admin

This author published 340 posts in this site.

Share

FacebookTwitterEmailWindows LiveTechnoratiDeliciousDiggStumbleponMyspaceLikedin

Leave a comment