Skip to content

Instantly share code, notes, and snippets.

@Mr-Kumar-Abhishek
Forked from bryhaw/git add -A
Created October 7, 2015 06:48
Show Gist options
  • Save Mr-Kumar-Abhishek/7fa4ffe3bb08f0e68df1 to your computer and use it in GitHub Desktop.
Save Mr-Kumar-Abhishek/7fa4ffe3bb08f0e68df1 to your computer and use it in GitHub Desktop.
Git: Adding and removing untracked/tracked files
git add -A" is equivalent to "git add .; git add -u
The important point about "git add ." is that it looks at the working tree and adds all those paths to the staged changes if they are either changed or are new and not ignored, it does not stage any 'rm' actions.
"git add -u" looks at all the currently tracked files and stages the changes to those files if they are different or if they have been removed. It does not add any new files, it only stages changes to already tracked files.
"git add -A" is a handy shortcut for doing both.
Source: http://stackoverflow.com/questions/572549/difference-between-git-add-a-and-git-add
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment