Say I have a branch “work” and a branch “ideas” in my git repository.
I usually work on my marvelous_file.cpp in “work” branch, but sometimes I would like to open
at the same time the marvelous_file.cpp that is in my “ideas” branch.
I don’t want to see what the differences between the two files, but rather take snippets of codes from the “ideas” branch and copy and past them in the file in the “work” branch.
Is this possible? If not, can I checkout the file in “ideas” into “work”, but with a different name?
You can use
git showto do that:This will show it right in the Terminal. If you want that as a file, just pipe it into a file, e.g.: