When I have:
how do I stage only the new ones?
git alias adduntracked=…
Adds all changes to existing files to the Staging Area. This includes changed files and deleted files - but not new files that aren't currently tracked by Git.
git add -p is basically "git add partial (or patch)" Patch mode allows you to stage parts of a changed file, instead of the entire file.
The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area.
This alias will respect your ignore patterns (builtin, global and per-directory, as described by the help for git-ls-files --exclude-standard
). It will run at the top level of your tree.
[alias]
adduntracked=!git add $(git ls-files -o --exclude-standard)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With