Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Github 如何使用gitbash登录我的回购协议?_Github - Fatal编程技术网

Github 如何使用gitbash登录我的回购协议?

Github 如何使用gitbash登录我的回购协议?,github,Github,我已经将自己添加到git bash程序中,但在google上找不到如何登录 $ git config --global user.name "myname" $ git config --global user.email myemail@example.com user.name和user.email与登录凭据无关。 它们是附加到提交的元数据 要“登录”,您需要添加一个远程url,该url将使用您的凭据,https或ssh凭据 git remote add origin https://Us

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

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

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

要“登录”,您需要添加一个远程url,该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\u rsa
id\u rsa.pub
私钥和公钥,公钥注册在您的GitHub帐户中:请参阅“”)


请参阅“”中的更多内容


如中所述,如果
origin
已经存在,请使用而不是
git remote add origin

来添加到该文件中。如果您已经克隆了repo,并且出现错误“远程源已存在”,则使用“git set url”而不是“git add”