Open sashadev-sky opened 5 years ago
Files already tracked by Git are not effected by the .gitignore file.
.gitignore
If you want to ignore a file that you've committed in the past,
echo
>>
git rm
--cached
$ echo debug.log >> .gitignore $ git rm --cached debug.log rm 'debug.log' $ git commit -m "Start ignoring debug.log"
Thanks, @sashadev-sky this is what we called cool hack.
Nice, thanks for sharing this!
Files already tracked by Git are not effected by the
.gitignore
file.If you want to ignore a file that you've committed in the past,
echo
with>>
(double redirection arrow) to append a relative file path to your.gitignore
directly from the terminal.git rm
with the--cached
option to delete the file from your remote repository, but keep it in your working directory as an ignored file.