Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git- Why .txt file is not ignored

Tags:

git

ignore

I need to ignore .txt file in git. To do so i have included *.txt in the .gitignore file.But when i edit something in one of my .txt file git is still tracking it. Where is the problem or do i make something wrong. Please help me.

like image 785
marco Avatar asked Jan 28 '13 16:01

marco


Video Answer


2 Answers

If you've ever committed the text file git is already tracking it. You need to remove it from git so that it will be untracked, then it will properly ignore it.

git rm --cached name.txt
like image 96
Ryan Poolos Avatar answered Sep 25 '22 06:09

Ryan Poolos


You probably already committed the file so it is tracked. You need to:

git rm --cached filename
like image 28
sjakubowski Avatar answered Sep 24 '22 06:09

sjakubowski