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!
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 ".
命令是“git add .”('.'而不是'*')并且不需要-A
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.