【问题标题】:How to use 2 different GIT remote servers on same Ubuntu machine? [closed]如何在同一台 Ubuntu 机器上使用 2 个不同的 GIT 远程服务器? [关闭]
【发布时间】:2019-05-25 15:15:46
【问题描述】:

我正在笔记本电脑上使用我的公司存储帐户。有时我开发我的个人项目,我想在这些项目中使用我的个人 Github 帐户。我知道如何通过来自here 的 ssh 密钥使用 2 个不同的 git 远程服务器

但我不想玩弄 ssh 密钥。我是否可以通过我的个人 github 帐户将 GIT 与 HTTPS 一起使用?

【问题讨论】:

标签: git ubuntu github ssh https


【解决方案1】:

我是否可以通过我的个人 github 帐户将 GIT 与 HTTPS 一起使用?

是的:只需将远程 URL 从 SSH 更改为 https:

cd /path/mto/my/repo
git remote set-url origin https://github.com/<me>/myproject

将其与 credential helper 组合以缓存凭据。
我会推荐 GCM(Git 凭据管理器),例如 Mac/Linux
这样,您就不必每次推送到远程存储库时都输入您的 GitHub 帐户密码。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-27
    • 1970-01-01
    • 2023-03-18
    • 2016-12-12
    • 2016-07-13
    • 2022-01-02
    • 2017-01-29
    • 1970-01-01
    相关资源
    最近更新 更多