将现有的远程仓库重新分配到我的本地仓库
reassign an existing remote repo to my local repo
所以我在这里没有得到关于 Git/Bitbucket 的信息,但我不确定具体是什么。也许有点超出我的理解范围。
我有一个项目已经休眠了一年,不知何故失去了与 Bitbucket 的联系。如何将现有的远程源重新分配到我的本地存储库?
我做了一个本地 git 提交(效果很好),但是当我在推送之前做了 git pull
时,我得到了这个:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
我试过了:
git branch --set-upstream-to=origin/git@bitbucket.org:<username>/<repo>.git master
...这没有用。我明白了:
error: the requested upstream branch 'origin/git@bitbucket.org:<username>/<repo>.git' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
我知道我有这个项目的 BitBucket 存储库(在我的浏览器中访问 BitBucket 证实了这一点),并且项目状态仅落后一次提交。
提前致谢。
而不是
git branch --set-upstream-to=origin/git@bitbucket.org:<username>/<repo>.git master
尝试使用
git branch --set-upstream-to=origin/master master
然后,运行一个git fetch
。
所以我在这里没有得到关于 Git/Bitbucket 的信息,但我不确定具体是什么。也许有点超出我的理解范围。
我有一个项目已经休眠了一年,不知何故失去了与 Bitbucket 的联系。如何将现有的远程源重新分配到我的本地存储库?
我做了一个本地 git 提交(效果很好),但是当我在推送之前做了 git pull
时,我得到了这个:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
我试过了:
git branch --set-upstream-to=origin/git@bitbucket.org:<username>/<repo>.git master
...这没有用。我明白了:
error: the requested upstream branch 'origin/git@bitbucket.org:<username>/<repo>.git' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
我知道我有这个项目的 BitBucket 存储库(在我的浏览器中访问 BitBucket 证实了这一点),并且项目状态仅落后一次提交。
提前致谢。
而不是
git branch --set-upstream-to=origin/git@bitbucket.org:<username>/<repo>.git master
尝试使用
git branch --set-upstream-to=origin/master master
然后,运行一个git fetch
。