I have a folder which I'd like to remove in my remote repository. I'd like to delete it, but keep the folder in my computer
+1
A:
git rm --cached -r somedir
will stage the deletion of the directory, but doesn't touch anything on disk.
jamessan
2010-08-12 16:21:31
And then add the path to .gitignore so git doesn't try to make you add it later.
grossvogel
2010-08-12 16:24:17
Will this result in (files in) the directory being removed when he pulls from the remote?
bstpierre
2010-08-12 16:24:39
Not when he pulls; the files will stay removed locally during the pull's automatic merge process. After that, a push will cause the files to be removed server-side.
Walter Mundt
2010-08-12 16:38:38
A:
I would just:
- Move the folder out of your working tree
git rm
the folder, commit the change- Add to
.gitignore
(or.git/info/excludes
), commit the change - Move the folder back
Jeff
2010-08-12 16:35:52