How do I stage all files at once in Git Gui?
Asked Answered
B

2

32

I have just created a GIT on a folder. I now want to add the contents of that folder by "staging" all the files. In the GUI, is there a way to select all the files. I have well over 4000 files and clicking one at a time is proving to be a bit of a pain.

Byrann answered 28/8, 2009 at 3:38 Comment(0)
S
63

Yes,

Select the items (select top one hit shift, select bottom one) and hit CTRL T

Or go to commit -> stage to commit

Skyway answered 28/8, 2009 at 3:45 Comment(6)
There are days when my mind seems to be smaller than my butt, but strangely full of the same thing :)Byrann
@baash, no big deal, it took me a while to find that setting its kind of hidden, I was expecting right click to work.Skyway
Ah. Thanks a lot. The operation "Stage to Commit" (Ctrl+T) wasn't informative for me. I thought it meant take whatever's listed under Staged Changes and commit them.Billybillycock
I agree "Stage to Commit" is not indicative of the operation it is about to perform. It should be called "Unstaged to Staged"Tilford
Bless you for answering this. Saved me lots of clicking misery!Ferricyanide
@Tilford Or perhaps "Stage in order to Commit"Botanomancy
E
5

Quite late, but one method is to add an option in the 'Tools' menu.

  1. Click 'Tools'>Add...
  2. Name it whatever you want (I chose 'add all')
  3. In the 'Command' field, type git add *
  4. Optionally check the boxes to remove a dialog window, output window, and global configuration.
  5. Click the Add button in the bottom right.

Now, click Tools>Add all and all changes will be staged. Hope this helps!

Edelmiraedelson answered 24/2, 2019 at 19:23 Comment(2)
is there a way to add multiple commands on a single name?Affirmatory
@Affirmatory Indeed, bash syntax can be used to merge multiple commands. So && can be placed between each command, where each next command only runs if the previous succeeds. Example: git add . && git commit -m "test commit" will both stage and commit your current changes with the message "test commit"Edelmiraedelson

© 2022 - 2024 — McMap. All rights reserved.