The error you are getting is not specific to git
but specific to bash
where the !
character is related to bash
history, to achieve what you are trying to do, you can escape the !
with
,
So something like
git add --all --:!.history :!.metadata :!.settings
But a cleaner approach will be to use a .gitignore
file and add entries for each of the above directories for that.
So your .gitignore
would look something like the following -
# contents of .gitignore
.history
.metadata
.settings
This .gitignore
file should be at the root of our repository.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…