git 推拉分支
这个问题已被问过几次,但我还没有找到我的具体用例: 我确实有一个 nas,它有 gitosis 并充当 git master。我有一台笔记本电脑和一台台式机,在笔记本电脑上我有一个分支沙箱,我想通过 nas 共享到桌面。 我尝试了 git
git push sandbox : sandbox (: sandbox being redundant)
但失败了。检查沙箱并做
git push origin HEAD
报告:
* [new branch] HEAD -> sandbox
现在在桌面上我这样做:
git remote show origin
并且我看到了新分支:
Remote branches:
master tracked
sandbox new (next fetch will store in remotes/origin)
这很有希望,所以现在我想将远程分支沙箱拉到桌面上的工作区:
git fetch origin sandbox (in the master branch)
它记录:
* branch sandbox -> FETCH_HEAD
但分支沙箱未创建当我展示树枝时。我缺少什么微不足道的东西吗?我也尝试过拉动,但这也无法按预期工作。问候, 杰罗恩.
This question has been asked a few times but i haven't found my specific use case:
I do have a nas which has gitosis and serves as a git master. I have a laptop and a desktop, on the laptop I do have a branch sandbox which I want to share via the nas on to the desktop.
I tried git
git push sandbox : sandbox (: sandbox being redundant)
which failed. Checking out sandbox and doing
git push origin HEAD
reports:
* [new branch] HEAD -> sandbox
Now on the desktop I do:
git remote show origin
and I see the new branch:
Remote branches:
master tracked
sandbox new (next fetch will store in remotes/origin)
That's promising so now I want to pull the remote branch sandbox into my workspace on the desktop with:
git fetch origin sandbox (in the master branch)
it logs:
* branch sandbox -> FETCH_HEAD
but branch sandbox is not created when I show the branches. Is there something trivial i'm missing? I also tried pulling but that also does not work as expected. regards,
Jeroen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您执行以下操作,则应列出沙箱:
您需要签出所述远程分支以在本地跟踪它
然后一个简单的 git 分支就会显示该分支。
sandbox should be listed if you do a:
You need to checkout said remote branch to track it locally
Then a simple
git branch
would show that branch.