Add all files to a commit except a single file?
git add -u git reset — main/dontcheckmein.txt Note: Git has subsequently added special syntax for this, which is explained in other answers.
git add -u git reset — main/dontcheckmein.txt Note: Git has subsequently added special syntax for this, which is explained in other answers.
For Git 1.x $ git add -u This tells git to automatically stage tracked files — including deleting the previously tracked files. For Git 2.0 To stage your whole working tree: $ git add -u :/ To stage just the current path: $ git add -u .
For Git 1.x $ git add -u This tells git to automatically stage tracked files — including deleting the previously tracked files. For Git 2.0 To stage your whole working tree: $ git add -u :/ To stage just the current path: $ git add -u .
This answer only applies to Git version 1.x. For Git version 2.x, see other answers. Summary: git add -A stages all changes git add . stages new files and modifications, without deletions (on the current directory and its subdirectories). git add -u stages modifications and deletions, without new files Detail: git add -A is equivalent … Read more
Maybe you just need to commit. I ran into this when I did: mkdir repo && cd repo git remote add origin /path/to/origin.git git add . Oops! Never committed! git push -u origin master error: src refspec master does not match any. All I had to do was: git commit -m “initial commit” git push … Read more