git 如何在 GitKraken 中签出提交?

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

How to checkout commit in GitKraken?

gitgitkraken

提问by Black

It seems to be impossible to checkout commits with GitKraken.

使用 GitKraken 检查提交似乎是不可能的。

Gitkraken commits options

Gitkraken 提交选项

As you can see there is no option to checkout older commits, only Cherrypick commitbut I don't know what this is good for.

如您所见,没有选项可以检出较旧的提交,Cherrypick commit但我不知道这有什么好处。

EDIT: I was able to checkout with another git program (git bash) via console:

编辑:我能够通过控制台使用另一个 git 程序(git bash)结帐:

console

安慰

Now it looks like this in GitKraken:

现在在 GitKraken 中看起来像这样:

gitkraken current head on specific commit

gitkraken 当前针对特定提交的负责人

回答by poke

GitKraken (as of version 1.7) does not seem to offer a way to get into a detached HEAD mode, and check out a commit directly. Similarly, it will also not allow you to check out a tag (since that would also give you a detached HEAD).

GitKraken(从 1.7 版开始)似乎没有提供进入分离 HEAD 模式并直接检查提交的方法。同样,它也不允许您签出标签(因为这也会给您一个分离的 HEAD)。

So instead, you will have to create a (temporary) branch first which you can then check out.

因此,您必须先创建一个(临时)分支,然后才能签出。

回答by DharmaTurtle

They finally implemented this feature yesterday(Sept. 25th, 2019).

他们终于在昨天(2019 年 9 月 25 日)实现了这个功能。

Users can now enter a detached HEAD state by clicking the commit you wish to checkout and selecting Checkout this commit.

用户现在可以通过单击要签出的提交并选择 来进入分离的 HEAD 状态Checkout this commit

enter image description here

在此处输入图片说明

回答by Carlos Pereira

You can make a UNDO in the top bar. Anothe option can be reset to another commit using the right click on the commit.

您可以在顶部栏中进行 UNDO。可以使用右键单击提交将另一个选项重置为另一个提交。

回答by skelom

The way you do this is by right clicking on your desired commit and select "Reset to this commit" and then choose "Hard - Discard all changes"

执行此操作的方法是右键单击所需的提交并选择“重置为此提交”,然后选择“硬 - 放弃所有更改”