git Commit、Commit 和 Push、Commit 和 Sync 之间的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30038999/
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
Differences between Commit, Commit and Push, Commit and Sync
提问by Alfred Waligo
I'm using visual studio 2013, and I'm faced with 3 options for when I commit my C# code. I need an explanation of the differences between each of the options with regards to what happens to my local repo vs. the GitHub repo.
我正在使用 Visual Studio 2013,当我提交 C# 代码时,我面临着 3 个选项。我需要解释每个选项之间关于我的本地存储库与 GitHub 存储库发生的情况的差异。
- Option 1 says Commit
- Option 2 says Commit and Push
- Option 3 says Commit and Sync
- 选项 1 表示提交
- 选项 2 表示提交和推送
- 选项 3 表示提交和同步
I don't quite understand the difference between the last 2 options. When should I use Commit and Sync as opposed to Commit and Push?
我不太明白最后两个选项之间的区别。什么时候应该使用提交和同步而不是提交和推送?
回答by camiblanch
- Commit will simply make record of your changes that you have made on your local machine. It will not mark the change in the remote repository.
- Commit and Push will do the above and push it to the remote repository. This means that any changes you have made will be saved to the remote repository as well.
- Commit and Sync does three things. First, it will commit. Second, it will perform a pull (grabs the updated information from the remote repo). Finally, it will push.
- Commit 只会记录您在本地机器上所做的更改。它不会标记远程存储库中的更改。
- Commit 和 Push 将执行上述操作并将其推送到远程存储库。这意味着您所做的任何更改也将保存到远程存储库。
- 提交和同步做了三件事。首先,它会提交。其次,它将执行拉取(从远程仓库中获取更新的信息)。最后,它会推动。
See more from Microsoft here
回答by A.sharif
回答by hmlasnk
Checkout on this. It will be helpfull for understand push, pull, commit and sync.
结帐。这将有助于理解推、拉、提交和同步。