git 结帐、获取和拉入 BitBucket SourceTree

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21595140/
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 17:41:08  来源:igfitidea点击:

Checkout, Fetch and Pull in BitBucket SourceTree

gitgithubbitbucketatlassian-sourcetreeproject-hosting

提问by Vishnu Y

I am using BitBucketfor web based hosting of our projects. Along with that I am using their SourceTreefor committing and such purpose. I am a bit confused with the Checkout, Fetchand Pulloption available in the SourceTree interface and their usage. Can someone familiar with this tool explains the usage of these options available in SourceTree?

我正在使用BitBucket来托管我们的项目。除此之外,我正在使用他们的SourceTree进行提交等目的。我对 SourceTree 界面中可用的CheckoutFetchPull选项及其用法有点困惑。熟悉这个工具的人可以解释一下 SourceTree 中这些选项的用法吗?

回答by lozadaOmr

Using Atlassian's Git tutorial(link updated) as a reference.

使用Atlassian 的 Git 教程(链接已更新)作为参考。

Git checkout:

Git结帐

The git checkout command lets you navigate between the branches created by git branch. Checking out a branch updates the files in the working directory to match the version stored in that branch, and it tells Git to record all new commits on that branch. Think of it as a way to select which line of development you're working on.

Source: https://www.atlassian.com/git/tutorials/using-branches#git-checkout

git checkout 命令允许您在 git branch 创建的分支之间导航。检出分支会更新工作目录中的文件以匹配该分支中存储的版本,并告诉 Git 记录该分支上的所有新提交。将其视为选择您正在从事的开发线的一种方式。

来源:https: //www.atlassian.com/git/tutorials/using-branches#git-checkout

Git pull:

git拉

You can think of git pull as Git's version of svn update. It's an easy way to synchronize your local repository with upstream changes. The following diagram explains each step of the pulling process.

Source: https://www.atlassian.com/git/tutorials/syncing#git-pull

您可以将 git pull 视为 Git 版本的 svn update。这是一种将本地存储库与上游更改同步的简单方法。下图解释了拉取过程的每个步骤。

来源:https: //www.atlassian.com/git/tutorials/syncing#git-pull

Git fetch:

git 获取

The git fetch command imports commits from a remote repository into your local repo. The resulting commits are stored as remote branches instead of the normal local branches that we've been working with. This gives you a chance to review changes before integrating them into your copy of the project.

Source: https://www.atlassian.com/git/tutorials/syncing#git-fetch

git fetch 命令将提交从远程存储库导入本地存储库。结果提交存储为远程分支,而不是我们一直在使用的普通本地分支。这使您有机会在将更改集成到您的项目副本之前查看更改。

来源:https: //www.atlassian.com/git/tutorials/syncing#git-fetch