简体   繁体   English

git GUI中Git add(ctrl + A)和Stage to Commit(ctrl + T)有什么区别?

[英]What's the difference between Git add (ctrl+A) and Stage to Commit (ctrl+T) in the git GUI?

如果git add CTRL + A开始跟踪更改并对已经跟踪的文件进行阶段更改,为什么我要在git gui中使用Stage to Commit CTRL + T

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 ! 以下是我的问题的答案:GIT GUI中的CTRL + A实际上是添加一个新的远程并且与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 . 在GIT GUI中,“添加”和“暂存”之间似乎没有任何区别,两者都是通过“stage to Commit”命令完成的: 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' 根据这个: http ://hoth.entp.com/2008/11/5/what-git-add-really-means,'git stage'是'git add'的别名

Thanks aardvarkk for your answer. 感谢aardvarkk的回答。 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 + T = GIT GUI中的“提交阶段”=命令行中的“git add”
CTRL + A = add a new remote CTRL + A =添加新的遥控器

Stage to Commit would be for a file that already has changes being tracked which you've since altered. Stage to Commit将用于已经跟踪的更改的文件。 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. 您通常只会“添加”一次文件以开始跟踪更改,然后您只需将文件暂存以进行已更改的提交。

According to git documentation , they are synonyms. 根据git文档 ,它们是同义词。 The command prepares the files for commit. 该命令准备要提交的文件。

Example: git add app_controller.php 示例: git add app_controller.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM