I added files to the repo and I didn’t want to track them!
Richard Rio Omolo
11

Nice article, if you are starting out on a project and you have added 20 files i would add them to a .gitignore and commit.

But if you are dealing with a fewer files say 2 then

git update-index — assume-unchanged <file>

seems like a better option, but since you are temporarily ignoring changes to file what happens when you

git add .

later wont that bring the file you had assumed back to the index?

Also if the file is already on your index i think you should remove it

git checkout <file>

before assuming it… if you add

ignore = update-index — assume-unchanged
ignore = update-index — no-assume-unchanged

to your .gitconfig alias you can quickly do

git ignore <file>

Thank you for the tips.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.