Permalink
Please sign in to comment.
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...
Showing
with
20 additions
and 0 deletions.
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