2

So I know we can checkout files from other branches into our current working branch with :

git checkout [someOtherBranch] [path/to/file] 

What I'm hoping is that something like this is possible :

git checkout [someOtherBranch] [path/to/file] [path/we/want/to/copy/to] 

Is this possible?

1
  • You can cherrypick the commits for that file, maybe. Commented Nov 2, 2015 at 23:04

1 Answer 1

5

You can cat the contents of the file and then use standard shell redirection to put it wherever you want.

git show [someOtherBranch]:path/to/file > newpath/to/file 
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. That was exactly what I was looking for

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.