Git: replace a folder with the same folder on another branch

I tried

git checkout OTHER_BRANCH -- /path/to/folder 

The problem is with files that exist in the current branch, but do not exist on another branch. I want to delete them.

+8
git git-checkout
source share
1 answer

I think you want:

 git rm -r /path/to/folder git checkout OTHER_BRANCH -- /path/to/folder 
+20
source share

All Articles