如何在 Windows 上使用 git 推送到 github?

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

How to push with git to github on Windows?

gitgithub

提问by Bozho

Simply, I can't:

简单地说,我不能:

  • HTTPS push

    • Eclipse git plugin doesn't support it (here)
    • msygit UI consumes all existing memory and hangs
    • turtoisegit consumes all existing memory and hangs
  • SSH push

    • generated the keypair, but it turns out github does not support putty, only ssh
    • I don't want to install cygwin
  • HTTPS 推送

    • Eclipse git 插件不支持它(这里
    • msygit UI 消耗所有现有内存并挂起
    • turtoisegit 消耗所有现有内存并挂起
  • SSH 推送

    • 生成了密钥对,结果发现github不支持putty,只支持ssh
    • 我不想安装 cygwin

采纳答案by Bozho

Well, using the Git bash of msysgit worked:

好吧,使用 msysgit 的 Git bash 工作:

git push <address>

(the GUI didn't work, even after reinstalling msysgit with different options)

(GUI 不起作用,即使在使用不同选项重新安装 msysgit 之后)

回答by namin

Getting Started with Git and GitHub on Windowshas the answer and will guide you through all the steps to start using Git and GitHub from Windows. In a nutshell: install msysgit(Git for Windows) and use it to generate the key.

在 Windows 上开始使用 Git 和 GitHub提供了答案,并将指导您完成从 Windows 开始使用 Git 和 GitHub 的所有步骤。简而言之:安装msysgit(Windows 版 Git)并使用它来生成密钥。

回答by Martin Geisler

You are correct that Putty generates a keypair in a different format than OpenSSH does. However, the Putty key generation tool lets you open one of its keys and can then produce an OpenSSH-compatible public key. It looks like this:

您是正确的,Putty 以与 OpenSSH 不同的格式生成密钥对。但是,Putty 密钥生成工具允许您打开其中的一个密钥,然后可以生成与OpenSSH 兼容的公钥。它看起来像这样:

Putty key gnerator

油灰钥匙发生器

You should be able to upload that to GitHub.

您应该能够将其上传到 GitHub。

回答by SLaks