简体   繁体   中英

Commiting all files ignores the ones in .gitignore?

I'm new at Git, so my question is:

Using

git commit -a -m "Message"

Will respect the .gitignore file? If I run

git add *

It says cannot do it since there are files changed and marked as being ignore.

The -a flag in git-commit does not commit all the files in the working directory, simply the ones that already exist in the repository that have changed. This is different from git add * which uses the shell expansion of * to add all of the files to staging, even the ones that git has not managed before.

(From git-commit man page)

-a --all

Tell the command to automatically stage files that have been modified and deleted, but new files you have not told git about are not affected.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM