Skip to content

Instantly share code, notes, and snippets.

@da-n
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save da-n/9775065 to your computer and use it in GitHub Desktop.
Save da-n/9775065 to your computer and use it in GitHub Desktop.
Remove directory from remote repository after adding them to .gitignore

The rules in .gitignore only apply to untracked files. If files under that directory have already been committed into the repository, unstage them, create a commit, and push that to master.

git rm -r --cached some-directory
git commit -m 'Remove the now ignored directory "some-directory"'
git push origin master

-- source http://stackoverflow.com/a/7927283/695454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment