Differences between Commit, Commit and Push, Commit and Sync

懵懂的女人 提交于 2020-01-09 12:06:34

问题


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.

  • Option 1 says Commit
  • Option 2 says Commit and Push
  • Option 3 says Commit and Sync

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?


回答1:


  1. 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.
  2. 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.
  3. 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.

See more from Microsoft here




回答2:


To add to camiegreenall's answer. I found this helpful picture/post from tanascius (here). "Here is a nice picture from Oliver Steele, that explains the git model and the commands:"




回答3:


Checkout on this. It will be helpfull for understand push, pull, commit and sync.

https://learn.sparkfun.com/tutorials/using-github-to-share-with-sparkfun/committing-pushing-and-pulling



来源:https://stackoverflow.com/questions/30038999/differences-between-commit-commit-and-push-commit-and-sync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!