Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.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

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回购分叉到Bitbucket_Git_Github_Bitbucket - Fatal编程技术网

将现有GitHub回购分叉到Bitbucket

将现有GitHub回购分叉到Bitbucket,git,github,bitbucket,Git,Github,Bitbucket,我很难将现有的GitHub回购协议转给Bitbucket。我使用终端使用git remote add,就像它在说明中所说的那样,但它一直报告致命:远程源已经存在。而且,当我试图推动它时,什么也没有发生。我已经查看了这里的答案来更改名称,但是我一直在使用GitHub链接,什么都没有发生。我不知道我是否正确地调用了fork remote origin和原始repo上游。有没有其他人有过和我一样的问题?我对它的工作原理还不太了解,并且还在不断学习 git remote add git remote r

我很难将现有的GitHub回购协议转给Bitbucket。我使用终端使用git remote add,就像它在说明中所说的那样,但它一直报告
致命:远程源已经存在
。而且,当我试图推动它时,什么也没有发生。我已经查看了这里的答案来更改名称,但是我一直在使用GitHub链接,什么都没有发生。我不知道我是否正确地调用了fork remote origin和原始repo上游。有没有其他人有过和我一样的问题?我对它的工作原理还不太了解,并且还在不断学习

git remote add
git remote rm
git push -u origin

当前方法的问题 这表明,当您尝试推送到Bitbucket时,出现了403禁止错误(很可能是因为您未通过身份验证)。我不熟悉Bitbucket,但在推送到GitHub存储库时,我在配置远程存储库URL时使用SSH传输而不是HTTPS。Atlassian网站提供了关于如何操作的良好文档,因此我建议在继续操作之前让此部件工作

此处,
origin
已设置为
https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git
可以从前面的
git remote-v
命令中看到


建议的方法 以下是从一个远程存储库更改为另一个远程存储库的步骤:

#更改到父目录(最好是桌面以外的目录)
cd/Users/appleuser/Desktop/
#删除当前目录。
rm-rf axios反应器/
#将GitHub存储库克隆到`axios react`目录中。
#使用“-o”选项将远程存储库标识为“github”,而不是“origin”。
git克隆-o githubhttps://github.com/ItsAntP/axios-react-github.git axios反应
#更改为存储库目录
cd-axios反应
#现在将Bitbucket远程存储库的URL添加为“源”。
git远程添加源https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git
#在尝试推送到Bitbucket之前,请确保已通过Bitbucket的身份验证。
git-push-u源主机
当前方法的问题 这表明,当您尝试推送到Bitbucket时,出现了403禁止错误(很可能是因为您未通过身份验证)。我不熟悉Bitbucket,但在推送到GitHub存储库时,我在配置远程存储库URL时使用SSH传输而不是HTTPS。Atlassian网站提供了关于如何操作的良好文档,因此我建议在继续操作之前让此部件工作

此处,
origin
已设置为
https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git
可以从前面的
git remote-v
命令中看到


建议的方法 以下是从一个远程存储库更改为另一个远程存储库的步骤:

#更改到父目录(最好是桌面以外的目录)
cd/Users/appleuser/Desktop/
#删除当前目录。
rm-rf axios反应器/
#将GitHub存储库克隆到`axios react`目录中。
#使用“-o”选项将远程存储库标识为“github”,而不是“origin”。
git克隆-o githubhttps://github.com/ItsAntP/axios-react-github.git axios反应
#更改为存储库目录
cd-axios反应
#现在将Bitbucket远程存储库的URL添加为“源”。
git远程添加源https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git
#在尝试推送到Bitbucket之前,请确保已通过Bitbucket的身份验证。
git-push-u源主机

谢谢。当我尝试推送时,它无法访问我的bitbucket回购,出现403页未找到错误。谢谢。当我尝试推送时,它无法访问我的bitbucket回购,出现403页未找到错误。
$ git init
Reinitialized existing Git repository in /Users/appleuser/Desktop/axios-react/.git/

$ git remote add origin https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git

$ git push -u origin master
remote: Forbidden
fatal: unable to access 'https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git/': The requested URL returned error: 403

$ git clone https://github.com/ItsAntP/axios-react-github.git
Cloning into 'axios-react-github'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 27 (delta 5), reused 27 (delta 5), pack-reused 0
Unpacking objects: 100% (27/27), done.

$ git remote -v
another_origin  https://github.com/ItsAntP/axios-react-github.git (fetch)
another_origin  https://github.com/ItsAntP/axios-react-github.git (push)
destination https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git (fetch)
destination https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git (push)
origin  https://github.com/ItsAntP/axios-react-github.git (fetch)
origin  https://github.com/ItsAntP/axios-react-github.git (push)
upstream    https://github.com/ItsAntP/axios-react-github.git (fetch)
upstream    https://github.com/ItsAntP/axios-react-github.git (push)

$ git remote add origin https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git
fatal: remote origin already exists.

$ git push origin master
Everything up-to-date

$ git push -u origin master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Everything up-to-date
$ git init
$ git remote add origin https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git
$ git push -u origin master
remote: Forbidden
fatal: unable to access 'https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git/': The requested URL returned error: 403
$ git clone https://github.com/ItsAntP/axios-react-github.git
$ git remote -v
another_origin  https://github.com/ItsAntP/axios-react-github.git (fetch)
another_origin  https://github.com/ItsAntP/axios-react-github.git (push)
destination https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git (fetch)
destination https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git (push)
origin  https://github.com/ItsAntP/axios-react-github.git (fetch)
origin  https://github.com/ItsAntP/axios-react-github.git (push)
upstream    https://github.com/ItsAntP/axios-react-github.git (fetch)
upstream    https://github.com/ItsAntP/axios-react-github.git (push)
$ git remote add origin https://XXX@bitbucket.org/crowddoingmedicinalfoods/react.git
fatal: remote origin already exists.