Reputation: 1068
Somehow, an .iml file has made its way into my git repo...
Here's how am I trying to get rid of it:
*.iml
git add * -A
git commit -m"untrack .iml file and ignore for future commits"
Problem:
On branch mybranch
Changes not staged for commit:
modified: .gitignore
deleted: myproject.iml
no changes added to commit
Why are they not staged for commit? I thought -A
would stage deletions too?
And also, in any way, I thought changes (like the one I made to .gitignore) are added to staging area without any special parameters?
It's weird because just before that, I committed a huge 20-file all-nighter, with changes, deletions, additions, branch within branch, all the goodies, with no problems - using the exact same procedure!
Upvotes: 1
Views: 110
Reputation: 27
the command is "git add . " ('.' enstead of '*') and no need for -A
Upvotes: 0
Reputation: 1329822
Never use '*
' with the git add command: '*
' means shell expansion, which, in your case, would not include any .xxx
file/folder.
Simply use:
git add .
(Note the '.
')
No need for -A
, which is the default anyway, since Git 2.0.
For more on this, see "Difference between .
(dot) and *
(asterisk) wildcards in Git".
Upvotes: 3