windows 将 Github 远程添加到 GitKraken
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37759755/
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
Add Github remote to GitKraken
提问by Jamie-505
I'm using GitKraken (v. 1.4.1) as my Git managing tool. And now I want to use Github as a remote to back up my repos. But when I click on add remote and try to add a Github repo, it just says 'no match'
我使用 GitKraken (v. 1.4.1) 作为我的 Git 管理工具。现在我想使用 Github 作为遥控器来备份我的存储库。但是当我点击添加远程并尝试添加 Github 存储库时,它只是说“不匹配”
Does anybody know why this happens? (BTW: I'm using Windows 10, just in case that's relevant)
有人知道为什么会这样吗?(顺便说一句:我使用的是 Windows 10,以防万一)
采纳答案by Jim Meyer
Here's how it seems to work. If you have a local repo and want to connect it to github, you would use the "URL" option and put in the github address to set that as the remote repo for your local repo. The first time you do a pull or push on a local branch, it will ask which remote branch you want to use and that becomes the remote location to which you will pushing and pulling changes.
这是它的工作原理。如果您有本地存储库并希望将其连接到 github,您可以使用“URL”选项并输入 github 地址以将其设置为本地存储库的远程存储库。第一次在本地分支上执行拉取或推送时,它会询问您要使用哪个远程分支,并且该分支将成为您将更改推送和拉取到的远程位置。
The GitHub.com option only comes into play after you have set the remote repo using the "URL" option. If there are multiple collaborators on a project and someone has created one or more forks of the project, then instead of "No Match" under the GitHub.com, you would see a list of all the forks of the project on which you are a collaborator.
GitHub.com 选项仅在您使用“URL”选项设置远程存储库后才起作用。如果一个项目有多个合作者,并且有人创建了该项目的一个或多个分支,那么在 GitHub.com 下,您将看到一个包含您所在项目的所有分支的列表,而不是“No Match”。合作者。
You could then add the forked repos as the 2nd, 3rd, etc. remotes, and any activity on those forks would be displayed to you on the commit graph. This allows people to see what's going on in the forks, and you can drag and drop from the forked parts of the graph to create pull requests to the repo you first set up using "URL".
然后,您可以将分叉的存储库添加为第 2、第 3 等遥控器,并且这些分叉上的任何活动都将在提交图上显示给您。这允许人们查看分叉中发生的事情,并且您可以从图表的分叉部分拖放以创建对您首先使用“URL”设置的存储库的拉取请求。
It's a nice feature, but the remote dialog could be labelled more clearly so that people would know the GitHub.com option was for adding forked repos to the commit graph display.
这是一个不错的功能,但可以更清楚地标记远程对话框,以便人们知道 GitHub.com 选项用于将分叉存储库添加到提交图显示。
You must always use the "URL" option to add the 1st remote, and then the GitHub.com option only becomes available after that if there are forks to which you have access.
您必须始终使用“URL”选项来添加第一个远程,然后 GitHub.com 选项仅在您可以访问的分叉之后才可用。
回答by VonC
If GitHub is set with your account in GitKraken, you might need to create first an empty repo with the same name as your local repo.
如果您在 GitKraken 中设置了 GitHub,则您可能需要先创建一个与本地存储库同名的空存储库。
That way, GitKraken can find a matching repo name in your GitHub account.
这样,GitKraken 可以在您的 GitHub 帐户中找到匹配的存储库名称。
Or you could select "URL
", and enter the right GitHub repo url directly there. Which is what Jim Meyer's answerconfirms above.
或者您可以选择“ URL
”,然后直接在那里输入正确的 GitHub 存储库 URL。这就是Jim Meyer的回答在上面证实的。
Note that GitKraken 6.5 (January 2020)will create, then add a GitHub fork repo automatically!
请注意,GitKraken 6.5(2020 年 1 月)将创建,然后自动添加一个 GitHub fork 存储库!
Forking GitHub Repositories in GitKraken
Formerly, users were required to leave GitKraken, go to their hosting service, fork the desired repository, come back to GitKraken, find the related remote, and then find the forked repo.
Now, GitHub users can fork repositories directly through the GitKraken GUI, no more time wasted context switching.
v6.5 allows users the ability to fork GitHub repositories in GitKraken through the GitHub integration.
Simply navigate to the remotes pane in the left panel and click the+
button to add a remote.If you don't already have a fork on the selected GitHub repository, GitKraken will automatically present you with the fork option.
You will see the message “You have not yet forked microsoft/vscode on GitHub.
”Click the
Fork and Add Remote
button, and it will fork the repo and add it as a remote to the left panel.
在 GitKraken 中分叉 GitHub 存储库
以前,用户需要离开 GitKraken,转到他们的托管服务,分叉所需的存储库,返回 GitKraken,找到相关的远程,然后找到分叉的存储库。
现在,GitHub 用户可以直接通过 GitKraken GUI 分叉存储库,不再浪费时间进行上下文切换。
v6.5 允许用户通过 GitHub 集成在 GitKraken 中分叉 GitHub 存储库。
只需导航到左侧面板中的遥控器窗格,然后单击+
按钮即可添加遥控器。如果您在所选的 GitHub 存储库上还没有分叉,GitKraken 将自动向您显示分叉选项。
您将看到消息“You have not yet forked microsoft/vscode on GitHub.
”单击该
Fork and Add Remote
按钮,它将分叉 repo 并将其作为遥控器添加到左侧面板。
回答by E.Racineux
Gitkraken (V3.3.4 64bits on windows) behaviour is strange at this feature level. Same name or URL input doesn't work for me. So the best and quick way to attach the remote repo to your local is to use the simple Git command line in local repo directory (git@... is your remote URL Github, GitLab...):
Gitkraken(Windows 上的 V3.3.4 64 位)在此功能级别的行为很奇怪。相同的名称或 URL 输入对我不起作用。因此,将远程存储库附加到本地的最佳和快速方法是在本地存储库目录中使用简单的 Git 命令行(git@... 是您的远程 URL Github、GitLab...):
> git remote add origin git@...
Gitkraken recognise dynamically it after less than 5 second . Then you can push your existing local files.
Gitkraken 在不到 5 秒后动态识别它。然后你可以推送你现有的本地文件。
回答by Tyler C
Not to add to an old posting but I had the same issue and found this article first so wanted to help anyone else having this issue.
不是要添加到旧帖子中,但我遇到了同样的问题并首先找到了这篇文章,所以想帮助其他遇到此问题的人。
You can get to it by doing the following.
您可以通过执行以下操作来获得它。
Click the folder icon in the top left corner
Click Clone
Go to the GitHub tab and you will see all your GitHub repos. Clone the one you want and then open it and you are set.
点击左上角的文件夹图标
单击克隆
转到 GitHub 选项卡,您将看到所有 GitHub 存储库。克隆你想要的那个,然后打开它,你就设置好了。