git 使用 tortoisegit 切换分支

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

Switch branches with tortoisegit

gitbranchswitch-statementtortoisegit

提问by Sebastian Müller

I cloned a git respository on my hard disc. This git repository contains not only the master but also a branch called newBranch. How can I checkout the new branch with tortoisegit?

我在硬盘上克隆了一个 git 存储库。这个 git 存储库不仅包含 master,还包含一个名为 newBranch 的分支。如何使用 tortoisegit 结帐新分支?

I tried it with the switch/checkout command but nothing changed in my local files. What works is when I clone the two branches in different folders like but I want to get it working with tortoisegit.

我用 switch/checkout 命令尝试过,但我的本地文件没有任何改变。有效的是当我将两个分支克隆到不同的文件夹中时,例如但我想让它与 tortoisegit 一起使用。

git clone localhost:testProject

git clone 本地主机:testProject

differs from

不同于

git clone localhost:testProject newBranch

git clone localhost:testProject newBranch

回答by Lieven Keersmaekers

You have a checkbox option Forcewhen switching branches in TortoiseGit.
Other than that, I must admit I'm stumped to.

Force在 TortoiseGit 中切换分支时有一个复选框选项。
除此之外,我必须承认我很难过。

回答by Sija

This is what worked for me:

这对我有用:

  • Right click base folder and choose "Git Clone...".
  • In the popup, give the Git repository path, choose appropriate local folder
  • select the Branch option and type-in your branch name. Click Ok.
  • 右键单击基本文件夹并选择“Git Clone...”。
  • 在弹出窗口中,给出 Git 存储库路径,选择合适的本地文件夹
  • 选择分支选项并输入您的分支名称。单击确定。

回答by aep

Go to settings from the context menu. General->Context Menu->Select 'Switch/Checkout'.

从上下文菜单转到设置。常规-> 上下文菜单-> 选择“切换/结帐”。

Afterwards it will be visible in the context menu.

之后它将在上下文菜单中可见。