GIT 删除远程源存储库,并更改默认存储库
GIT deleting remote orgin repository, and changing default one
需要git大师的帮助)))
现状是这样的:
- 我在本地创建了我的项目,将所有内容推送到 github。
- 我 git 从 github
克隆项目到 VPS
- 随着时间的流逝,需要从 github 迁移到 bitbucket(财务问题)
- 现在,当我从 bitbucket 中提取更改时,我必须
git pull bitbucket [branch_name]
问题:
目前我想从 github 中删除我的原始存储库,我有 2 个问题:
它是否会破坏我的 VPS 中的任何内容。我的意思是 github 是我的
原始repo,所以不会有任何问题吗?
如何将我的 bitbucket 存储库设置为默认存储库,这样我就不会
必须输入:
git 拉 bitbucket [branch_name]
但是,只需键入:
git拉[branch_name]
您想将 origin
更改为指向您的 bitbucket url,然后删除您的 bitbucket 遥控器。您必须在 VPS 和本地都执行此操作。它不应该破坏你的 VPS.
中的任何内容
如果你执行 git remote -v
你会看到原点指向 github
origin git@github.com:USERNAME/REPOSITORY.git (fetch)
origin git@github.com:USERNAME/REPOSITORY.git (push)
bitbucket git@bitbucket.org:USERNAME/REPOSITORY.git(fetch)
bitbucket git@bitbucket.org:USERNAME/REPOSITORY.git (push)
要更改它,只需使用:
git remote set-url origin git@bitbucket.org:USERNAME/REPOSITORY.git
再次运行宁git remote -v
验证更改
origin git@bitbucket.org:USERNAME/REPOSITORY.git(fetch)
origin git@bitbucket.org:USERNAME/REPOSITORY.git (push)
bitbucket git@bitbucket.org:USERNAME/REPOSITORY.git(fetch)
bitbucket git@bitbucket.org:USERNAME/REPOSITORY.git (push)
删除您的 bitbucket 遥控器
git remote rm bitbucket
然后 运行 再次 git remote -v
你应该只会看到 origin
origin git@bitbucket.org:USERNAME/REPOSITORY.git(fetch)
origin git@bitbucket.org:USERNAME/REPOSITORY.git (push)
需要git大师的帮助)))
现状是这样的:
- 我在本地创建了我的项目,将所有内容推送到 github。
- 我 git 从 github 克隆项目到 VPS
- 随着时间的流逝,需要从 github 迁移到 bitbucket(财务问题)
- 现在,当我从 bitbucket 中提取更改时,我必须
git pull bitbucket [branch_name]
问题:
目前我想从 github 中删除我的原始存储库,我有 2 个问题:
它是否会破坏我的 VPS 中的任何内容。我的意思是 github 是我的 原始repo,所以不会有任何问题吗?
如何将我的 bitbucket 存储库设置为默认存储库,这样我就不会 必须输入:
git 拉 bitbucket [branch_name]
但是,只需键入:
git拉[branch_name]
您想将 origin
更改为指向您的 bitbucket url,然后删除您的 bitbucket 遥控器。您必须在 VPS 和本地都执行此操作。它不应该破坏你的 VPS.
如果你执行 git remote -v
你会看到原点指向 github
origin git@github.com:USERNAME/REPOSITORY.git (fetch)
origin git@github.com:USERNAME/REPOSITORY.git (push)
bitbucket git@bitbucket.org:USERNAME/REPOSITORY.git(fetch)
bitbucket git@bitbucket.org:USERNAME/REPOSITORY.git (push)
要更改它,只需使用:
git remote set-url origin git@bitbucket.org:USERNAME/REPOSITORY.git
再次运行宁git remote -v
验证更改
origin git@bitbucket.org:USERNAME/REPOSITORY.git(fetch)
origin git@bitbucket.org:USERNAME/REPOSITORY.git (push)
bitbucket git@bitbucket.org:USERNAME/REPOSITORY.git(fetch)
bitbucket git@bitbucket.org:USERNAME/REPOSITORY.git (push)
删除您的 bitbucket 遥控器
git remote rm bitbucket
然后 运行 再次 git remote -v
你应该只会看到 origin
origin git@bitbucket.org:USERNAME/REPOSITORY.git(fetch)
origin git@bitbucket.org:USERNAME/REPOSITORY.git (push)