Imagine that I have a repository with directories Dir1 and Dir2 and I am in branchA.
Imagine that I want to get rid of contents of Dir2 and replace them with Dir2 in the master branch, while keeping the content of Dir1.
I don't expect this to be that simple, but ideally :
cd Dir2
git [magic that replaces current dir with the contents of master branch]
remove Dir2
from branchA
and
fetch it from master
branch:
$ git checkout branchA
$ git rm -r Dir2
$ git checkout master -- Dir2
$ git commit -m "replaced Dir with Dir2 from master"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With