FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

til/git/untrack-a-file-without-deleting-it.md at master · ljesparis/til · GitHub

Repository navigation

Latest commit

 

History

History
18 lines (13 loc) · 640 Bytes
  1. til
  2. git

untrack-a-file-without-deleting-it.md

File metadata and controls

18 lines (13 loc) · 640 Bytes

Untrack A File Without Deleting It

Generally when I invoke git rm <filename>, I do so with the intention of removing a file from the project entirely. git-rm does exactly that, removing the file both from the index and from the working tree.

If you want to untrack a file (remove it from the index), but still have it available locally (in the working tree), then you are going to want to use the --cached flag.

$ git rm --cached <filename>

If you do this, you may also consider adding that file to the .gitignore file.

source


Back | FazBrowse Home | New Git URL