Sourcetree中现有的检出和检出的新分支之间的区别 [英] Difference between checkout existing and checkout new branch in Sourcetree

查看:1771
本文介绍了Sourcetree中现有的检出和检出的新分支之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在sourcetree中,我只想签到远程开发分支,以便可以在其中开始一个新的功能分支.我目前在另一个功能分支中,已经提交并推送了所有更改.

In sourcetree I would like to just check out to the remote develop branch so I can start a new feature branch in there. I'm currently in another feature branch in which I have committed and pushed all my changes.

但是,当我右键单击远程分支的源/开发时,我得到以下信息:

However when I right click on remote branch origin/develop I get this:

由于某种原因,我在这里找不到任何区别.我不想中断我的新工作,所以我非常小心.在GitKraken中,您只需签到远程帐户即可,并在必要时更新本地开发分支.

For some reason I can find nowhere what is the difference here. I don't want to break the repo at my new job, so I'm super careful. In GitKraken you just checkout to remote and update your local develop branch if necessary.

推荐答案

它的作用是:

git checkout -b develop --track origin/develop

这将确保本地分支develop在默认情况下将推送到远程分支origin/develop.

That will make sure the local branch develop will push to, by default, the remote branch origin/develop.

请注意,使用Git 2.23+时,将为 git switch

Note that with Git 2.23+, that would be git switch

git switch -c develop --track origin/develop

SourceTree尚未集成该新命令.

SourceTree has not yet integrated that new command.

我不想中断新工作的回购,所以我非常小心

I don't want to break the repo at my new job, so I'm super careful

这不会破坏任何东西:这只是本地操作.

That won't break anything: this is a local operation only.

这篇关于Sourcetree中现有的检出和检出的新分支之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆