I am royally confused with what git checkout [<tree-ish>] [--] <pathspec>….. does
from git documentation
My repo. contains folders and I have an old branch lets call it old_branch. I want to merge one folder from the old_branch to my dev
I switched to my dev like so:
git checkout dev then I wanted to merge one folder from my old branch to dev
git checkout <old_branch> --myfolder Question: Does it do a merge with my dev , or simply replaces code from my old_branch and marks it as "merged"
since when I tried doing git checkout -b new_branch, committing and then doing git merge dev , it told me that there were no changes (up to date).
When examining the code I see lots of deletes that should not have happened.
Update 1 I want to merge (combine changes) the content of one of subfolders in my current tree (dev) with the content of one of my subfolders in the tree (old_branch)
Update 2 Looks like I asked a wrong question. The real question should be is how to merge a subfolder in a mono-repo set up . I don't think there is an automated way to do this. I ended up doing it by hand.
git checkoutattempt to merge files, usinggit checkout -m. Don't go there :-) ... at least not now, because that really will muddy the waters. As long as you're not usinggit checkout -m(which gets complicated), see Ross Hunter's answer.