Reputation: 4329
Let's say that I have a file core.clj in branch master at HEAD which is distinct from core.clj in branch other at HEAD, and that I am currently in branch other. I would like to checkout master's core.clj into the current branch with some other file name, say tmp.clj, for easy comparison.
How can I do this?
Upvotes: 5
Views: 92
Reputation: 62369
You can use git show master:core.clj
to show the file. Redirect it to a new file (git show ... > temp.clj
to save it for further processing.
Upvotes: 7
Reputation: 2505
You don't need to; git diff
will do exactly what you need to do. git diff master otherbranch core.clj
is a basic use of the command, and if you need more help, man git-diff
can explain more to you.
Upvotes: 1