I usually do this:
git init
git add .
git commit .
And then I realize that it's about to add my nbproject directory, which I want excluded/ignored. Sometimes, I even check in this directory. Had I added it to .git/info/exclude before running git add., everything works fine (it's excluded).
So then I modify .git/info/exclude and then it's too late. git no longer respects changes to .git/info/exclude.
So the questions are:
- How can I get git to take up the changes in the exclude file in the checkin? (I tried running git add . again, which doesn't help)
- Let's say I check in a directory (or file) that I want excluded. What is the least number of steps to get to the state I want (with the file excluded).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…