3

If git add CTRL+A starts tracking changes AND stages changes to already tracked files, why should I ever use Stage to Commit CTRL+T in the git gui ?

Mwiza
  • 7,780
  • 3
  • 46
  • 42
Nike
  • 1,223
  • 2
  • 19
  • 42

3 Answers3

3

Here's the answer to my question: CTRL+A in the GIT GUI is actually to ADD A NEW REMOTE and is not the same as GIT ADD ! In the GIT GUI, there does not seem to be any distinction between 'adding' and 'staging' , both are done by the 'stage to Commit' command: CTRL+T. And according to this: http://hoth.entp.com/2008/11/5/what-git-add-really-means , 'git stage' is an alias for 'git add'

Thanks aardvarkk for your answer. I suppose 'adding' can be considered the 'first staging' of a file, but really 'adding' means 'adding to the stage' or 'staging to commit'.

Concisely,
CTRL+T = 'stage to commit' in the GIT GUI = 'git add' at the command line
CTRL+A = add a new remote

Mwiza
  • 7,780
  • 3
  • 46
  • 42
Nike
  • 1,223
  • 2
  • 19
  • 42
1

According to git documentation, they are synonyms. The command prepares the files for commit.

Example: git add app_controller.php

Trey Copeland
  • 3,387
  • 7
  • 29
  • 46
matti
  • 11
  • 1
1

Stage to Commit would be for a file that already has changes being tracked which you've since altered. You would generally only "add" a file once to begin tracking changes, and thereafter you would simply stage the file for commit that you've changed.

aardvarkk
  • 14,955
  • 7
  • 67
  • 96
  • 1
    But "add" , ie CTRL+A , also stages changes to tracked files, so CTRL+T seems redundant. – Nike Mar 29 '12 at 17:54