tags:

views:

45

answers:

2

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
And then add the path to .gitignore so git doesn't try to make you add it later.
grossvogel
Will this result in (files in) the directory being removed when he pulls from the remote?
bstpierre
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
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