git push 到两个远程的创库,github、bitbucket

发布于 2022-09-01 16:18:11 字数 1156 浏览 11 评论 0

我现在有一个本地创库,可以push到bitbucket上去,但是push到github上就会报错,如下:

remote: Permission to leopardpan/blog.git denied to leopardpanbaixin.
fatal: unable to access 'https://github.com/leopardpan/blog.git/': The requested URL returned error: 403 。

我的config如下:

[remote "origin"]
url = https://github.com/leopardpan/blog.git
fetch = +refs/heads/:refs/remotes/origin/
[remote "bit"]
url = https://leopardpan@bitbucket.org/flutterSnow/demo-one.git
fetch = +refs/heads/:refs/remotes/bit/
[branch "master"]
remote = origin
remote = bit
merge = refs/heads/master

我的两个远程创库都存在,url也添加进来了,但是push到github上就会失败,push到bitbucket能成功。我猜是不是,之前我设置
git config --global user.name leopardpan
git config --global user.email panbaixin123@163.com
导致两个远程创库配置问题,但是我安装都是根据github的name和email配置的啊。

请帮帮我,非常感谢!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ぺ禁宫浮华殁 2022-09-08 16:18:12
git remote set-url origin https://leopardpan@github.com/leopardpan/blog.git
git push origin master
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文