git - Add all files to a commit except a single file? - Stack Overflow
1) To start ignoring changes to a single already versioned file
git update-index --assume-unchanged "main/dontcheckmein.txt"
and to undo that git update-index --no-assume-unchanged "main/dontcheckmein.txt"
2) To completely ignore a specific single file preventing it from being created at repository
First look at this Git global ignore not working
and at .gitignore
add the relative path to the file without leading ./
so if your file is at MyProject/MyFolder/myfile.txt
(where .git
is also at MyProject
), at .gitignore
you put just this MyFolder/myfile.txt
Read full article from git - Add all files to a commit except a single file? - Stack Overflow
No comments:
Post a Comment