Skip to content
Browse files

Article: Untrack files from .gitignore

Wiki article for issue #367: untrack files previously committed from new .gitignore

Rename Ignore-files-committed-to-git-repo.md to Ignore-Files-Committed-To-Git-Repo.md

Uses proper markdown

Also fixed some typos.
closes #570

Fix style
  • Loading branch information...
1 parent b43a184 commit 8cb3c90cf728b7e22b09a0137cc9139d603232b6 @aaronTHJ aaronTHJ committed with Rafase282
Showing with 20 additions and 0 deletions.
  1. +20 −0 Ignore-Files-Committed-To-Git-Repo.md
View
20 Ignore-Files-Committed-To-Git-Repo.md
@@ -0,0 +1,20 @@
+# Untrack files previously committed from new .gitignore
+To untrack a _single_ file, ie stop tracking the file but not delete it from the system use:
+
+`git rm --cached filename`
+
+To untrack _every_ file in `.gitignore`:
+
+First **commit** any outstanding code changes, and then run:
+
+`git rm -r --cached`
+
+This removes any changed files from the index(staging area), then run:
+
+`git add .`
+
+Commit it:
+
+`git commit -m ".gitignore is now working"`
+
+To undo `git rm --cached filename`, use `git add filename`

0 comments on commit 8cb3c90

Please sign in to comment.
Something went wrong with that request. Please try again.