git 源树中推/拉和提交之间的区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18017800/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 16:41:49  来源:igfitidea点击:

Difference between a push / pull and commit in source tree?

gitatlassian-sourcetree

提问by Breako Breako

Is it possible to see the difference between a push / pull and a commit in the log view in SourceTree?

是否可以在 SourceTree 的日志视图中看到推/拉和提交之间的区别?

回答by xero

a commit is saving the state of your code into version control

提交将代码状态保存到版本控制中

http://git.github.io/git-reference/basic/#commit

http://git.github.io/git-reference/basic/#commit

a push is sending your commited coded to a remote server (e.g. github)

推送正在将您提交的代码发送到远程服务器(例如 github)

http://git.github.io/git-reference/remotes/#push

http://git.github.io/git-reference/remotes/#push

a fetch is downloading the newest changes from a remote server to your local repository, but keeping your repo as is.

fetch 正在将最新的更改从远程服务器下载到您的本地存储库,但保持您的存储库原样。

http://git.github.io/git-reference/remotes/#fetch

http://git.github.io/git-reference/remotes/#fetch

a pull is downloading the newest changes from a remote server to your local repository and checking out the newest code from the repo.

拉取是将最新的更改从远程服务器下载到您的本地存储库,并从存储库中检出最新代码。

http://git.github.io/git-reference/remotes/#pull

http://git.github.io/git-reference/remotes/#pull

回答by Cees Timmerman

Yesit is possible to see the difference between a push / pull and a commit in the log view in SourceTree. In this screenshot, everything between testand origin/testis your local commit log:

是的,可以在 SourceTree 的日志视图中看到推/拉和提交之间的区别。在此屏幕截图中,test和之间的所有内容origin/test都是您的本地提交日志:

SourceTree git log view with diff between pull and commit

SourceTree git 日志视图与拉取和提交之间的差异

Selecting both labels, the changes show that I've twice committed an edit of the same comment, explaining the 2 pushable commits.

选择两个标签,更改表明我已经两次提交了对同一评论的编辑,解释了 2 次可推送提交。

After you modify more without committing, and others push their commits, it can look like this:

在你修改更多而不提交,其他人推送他们的提交后,它看起来像这样:

SourceTree git log view with ahead/behind info

SourceTree git 日志视图与前/后信息

origin/testis now 2 commits ahead of our (now red) testbranch HEADthat was pulled from the 807... commit and has not been merged (by push or pull) into origin/testyet. This becomes more obvious when selecting Ancestor Order:

origin/test现在是我们的(现在是红色)test分支之前的 2 个提交,HEAD该分支从 807... 提交中提取并且尚未合并(通过推或拉)origin/test。这在选择时变得更加明显Ancestor Order

SourceTree git log view with ahead/behind info and Ancestor Order graph

SourceTree git log view with ahead/behind info and Ancestor Order graph