Reputation: 27508
I have a situation where a folder needs to be patched to be the same state as a repository. Consider this short tale:
Ten years age Goofus and Gallant are somewhat alike and at a fork in the road Gallant moves onward and becomes a better person. Goofus hangs out and does nothing. The almighty pointy hair decrees Goofus must become more like Gallant again. How can Gallant patch Goofus without making him a clone ?
What's the best way to get the patch ?
Should I make a branch and mutate Gallant back to Goofus and then make an inverse patch ?
Upvotes: 1
Views: 52
Reputation: 1328342
If you want to simply import Goofus back into Gallant (which will be the same as a patch), simply download an archive (zip or tarball) of Goofus, and uncompress it somewhere, then use it as working tree for a one-time import:
cd /path/to/Gallant
git --work-tree=/path/to/Unzipped/Goofus add .
git commit -m "Goofus import"
git push
The git add
part will detect any modified, added or removed files from Goofus, and add them in the Gallant repo.
Upvotes: 1