I made changes to some of my files in my local repo, and then I did git add -A
which I think added too many files to the staging area. How can I delete all the files from the staging area?
After I do that, I'll just manually do git add "filename"
.
git status
already tells you exactly what to do if you want to unstage files.git add -p
orgit add --patch
(they're the same). That flag allows you to interactively select which files or individual changes you want to stage -- you can then get a lot more finely grained with what work you include in the commit.git status
and then use the commandxargs git add
. I can than select the files in the status (left click of the mouse) and then paste it using the right click of the mouse or <kbd>Shift-Insert</kdb>. For a range of files, I use <kbd>Alt</kbd> and do a box selection using the mouse and then paste them as a group. At the end of each paste, I would press <kbd>Enter</kbd> and at the end of all pasting, I would press <kbd>Ctrl-D</kbd> to apply the files to thegit add
command.