git 适用于 Windows 的 GitHub 是否可以与 GitLab 一起使用?

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

Does GitHub for Windows work with GitLab?

gitgitlabgithub-for-windows

提问by Qwerky

While working on a project using GitHub I've fallen in love with GitHub for Windows as a client. Now a new project beckons where I'll be using GitLab instead of GitHub.

在使用 GitHub 进行项目时,我爱上了 GitHub for Windows 作为客户端。现在一个新项目召唤我使用 GitLab 而不是 GitHub。

Will I still be able to use GitHub for Windows as a client for GitLab? After all, they're both based on git, right? If not, what clients are available for GitLab?

我仍然可以使用 GitHub for Windows 作为 GitLab 的客户端吗?毕竟,它们都是基于 git 的,对吧?如果没有,哪些客户端可用于 GitLab?

采纳答案by Steven V

Yes, you can use the Windows GitHub client and the GitHub Desktop client with GitLab, BitBucket or any other hosted Git solution.

是的,您可以将 Windows GitHub 客户端和 GitHub 桌面客户端与 GitLab、BitBucket 或任何其他托管 Git 解决方案一起使用。

We only use it with HTTPS and you'll need a valid certificate if you do use HTTPS. It may work with HTTP as well. We never did get SSH to work completely right since it's a tough to inject your own SSH keys into the application.

我们仅将其与 HTTPS 一起使用,如果您确实使用 HTTPS,则需要一个有效的证书。它也可以与 HTTP 一起使用。我们从来没有让 SSH 完全正确地工作,因为将您自己的 SSH 密钥注入到应用程序中是很困难的。

If you want to clone a repository, you have to drag and drop the HTTP URL onto the GitHub application.

如果要克隆存储库,则必须将 HTTP URL 拖放到 GitHub 应用程序上。

I was unable to get the drag and drop trick to work on OS X. But you can add locally cloned repositories into the OSX version and then the application works like normal. And OSX supports SSH keys unlike the Windows version.

我无法在 OS X 上使用拖放技巧。但是您可以将本地克隆的存储库添加到 OSX 版本中,然后应用程序可以正常工作。与 Windows 版本不同,OSX 支持 SSH 密钥。

回答by Deb

Yes you can use GitHub For Windows with GitLab, You can even use SSH. (The accepted answer didn't get SSH working, but here is how you get it working.)

是的,您可以将 GitHub For Windows 与 GitLab 一起使用,您甚至可以使用SSH。(接受的答案没有让 SSH 工作,但这里是你如何让它工作。)

  1. Add your public ssh key from github_rsa.pub (which is found in your .ssh folder) to your SSH keys on Gitlab.com
  2. Add a configfile to your .ssh folder that looks like this

    Host gitlab.com
    RSAAuthentication yes
    IdentityFile ~/.ssh/github_rsa
    User mygitlabloginemail
    
  3. Clone / pull your repository through Git Bash

  4. Drag the folder to Github For Windows
  1. 将 github_rsa.pub(位于 .ssh 文件夹中)中的公共 ssh 密钥添加到 Gitlab.com 上的 SSH 密钥
  2. 将一个config文件添加到您的 .ssh 文件夹中,如下所示

    Host gitlab.com
    RSAAuthentication yes
    IdentityFile ~/.ssh/github_rsa
    User mygitlabloginemail
    
  3. 通过 Git Bash 克隆/拉取您的存储库

  4. 将文件夹拖到 Github For Windows

And thats it, you can now use Github for Windows with your gitlab repository.

就是这样,您现在可以将 Github for Windows 与您的 gitlab 存储库一起使用。

回答by sachinjain024

The answer is YES. You can use GitHub for Windows on GitLab. And not just on Gitlab, you can use it for repositories on Bitbucketas well.

答案是肯定的你可以在 GitLab 上使用 GitHub for Windows。不仅在 Gitlab 上,您还可以将它用于Bitbucket 上的存储库。

回答by steventaitinger

The GitHub for Windows application allows you to manually add and work with repositories from any remote location (ie GitLab/BitBucket...) or local location (your hard drive or network folder).

GitHub for Windows 应用程序允许您从任何远程位置(即 GitLab/BitBucket...)或本地位置(您的硬盘驱动器或网络文件夹)手动添加和使用存储库。

However, it only has the option to add your account info for GitHub. Whatever functionality that is tied to that account login will only work for GitHub. I am guessing that functionality is automatically recognizing all your GitHub repositories.

但是,它只能选择为 GitHub 添加您的帐户信息。与该帐户登录相关的任何功能仅适用于 GitHub。我猜这个功能会自动识别你所有的 GitHub 存储库。

回答by Jorge Pabón

I use it with GitLab all the time.

我一直将它与 GitLab 一起使用。

I Clone the Repo from Terminal then do all my commits, pushes and pulls from the GitHub Desktop interface.

我从终端克隆 Repo,然后从 GitHub 桌面界面执行我所有的提交、推送和拉取操作。

回答by AmiD MajD

Yes, go to your Gitlab repo and copy HTTPSremote address of that repo then in Github-Desktop you can change the remote address to HTTPS one.

是的,转到您的 Gitlab 存储库并复制该存储库的HTTPS远程地址,然后在 Github-Desktop 中您可以将远程地址更改为 HTTPS 远程地址。

This is because Github-Desktop doesn't support SSHyet.

这是因为 Github-Desktop 还不支持SSH