Jacko
Jacko

Reputation: 13195

git: replace folder with the same folder on a different branch

I tried

git checkout OTHER_BRANCH -- /path/to/folder

the problem is with files that exist on current branch, but do not exist on the other branch. I want to delete these.

Upvotes: 25

Views: 11346

Answers (1)

manojlds
manojlds

Reputation: 301127

I think you want:

git rm -r /path/to/folder
git checkout OTHER_BRANCH -- /path/to/folder

Upvotes: 45

Related Questions