git 推拉分支

发布于 2024-11-09 17:25:07 字数 820 浏览 0 评论 0原文

这个问题已被问过几次,但我还没有找到我的具体用例: 我确实有一个 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 技术交流群。

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

发布评论

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

评论(1

水水月牙 2024-11-16 17:25:07

如果您执行以下操作,则应列出沙箱:

git branch --all

您需要签出所述远程分支以在本地跟踪它

git checkout --track origin/sandbox

然后一个简单的 git 分支就会显示该分支。

sandbox should be listed if you do a:

git branch --all

You need to checkout said remote branch to track it locally

git checkout --track origin/sandbox

Then a simple git branch would show that branch.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文