Git checkout to specific directory
So, currently I am working on merging two branches,
I’m merging into branch
B, but I had restructured the project into different directories and would like to do a
git checkout A --path/fileToGet of sorts (to overwrite is the intention) but into a different directory in my branch. To keep revision history for the file, what would be the best thing, do I just checkout the file like normal,
rm my current file and then
git mv (or maybe just a regular
mv and maybe git will follow` it? Or is there a better method to follow?
I had found in some comments here at SO that when using
git diff A:path/file B:anotherPath/file I am able to compare the two files, so I’m thinking there might be another way, using the
: to specify from where, to where.
One Solution collect form web for “Git checkout to specific directory”
rm the current directory and then used
git checkout A --path/to/old/location to check the old file location out.