git animals had this series of commands:
git init
git add *
git commit -a -m ‘initial commit and release!’
What does git add * do compared to git add . (which I normally do) are they the same?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
git add *will add all the paths that are the result of the shell expansion of*whereasgit add .will tell git to add the current directory.git add *won’t add paths that begin with a.as the shell expansion of*considers these to be “hidden” paths.git add *will also fail if any expanded path is currently being ignored by git because git considers it an error if you explicitly specify an ignored path without passing the-f(force) flag to show that you really want to add an ignored path.If you get git to expand the glob (
git add '*') it will add “hidden” files and skip over ignored files. It would work the same asgit add .in this case.