gpt4 book ai didi

github - 如何使用 git bash 登录我的仓库?

转载 作者:行者123 更新时间:2023-12-03 18:33:10 33 4
gpt4 key购买 nike

我已将自己添加到 git bash 程序,但在 google 上找不到如何登录?

$ git config --global user.name "myname"
$ git config --global user.email myemail@example.com

最佳答案

user.name 和 user.email 与登录凭据无关。
它们是附加到您的提交的元数据。

要“登录”,您需要添加一个远程 url,它将使用您的凭据,https 或 ssh 之一。

git remote add origin https://UserName:password@github.com/UserName/yourRepo.git
^
|
(credentials)

或 ssh:
git remote add origin git@github.com/UserName/yourRepo.git

(这意味着您在 HOME/.ssh 中拥有您的 id_rsaid_rsa.pub 私钥和公钥,公钥注册在您的 GitHub 帐户中:参见“ Generating SSH Keys”)

在“ Which remote URL should I use?”处查看更多信息。

正如 paddymac 中的 the comments 所指出的,如果 origin 已经存在,则使用 git remote set-url origin 而不是 git remote add origin

关于github - 如何使用 git bash 登录我的仓库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20838207/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com