如何推送所有远程分支
我有一个GIT存储库,其中有4个本地分支和许多远程分支,我想将整个存储库推送到裸存储库(包括远程分支)。我尝试使用 git Push origin,但远程分支没有被推送。
我的配置文件看起来像这样
[remote "origin"]
etch = +refs/heads/*:refs/remotes/origin/*
url = git://my-server/local/android/kernel/linux-android.git
pushurl = git@my-server:/local/android/kernel/linux-android.git
push = +refs/heads/*:refs/remotes/origin/*
I have a GIT repository in which there are 4 local branch and numerous remote branch, I want to push the entire repository to the bare repository (including remote branches). I tried using git push origin, but remote branch did not get pushed.
My config file looks like this
[remote "origin"]
etch = +refs/heads/*:refs/remotes/origin/*
url = git://my-server/local/android/kernel/linux-android.git
pushurl = git@my-server:/local/android/kernel/linux-android.git
push = +refs/heads/*:refs/remotes/origin/*
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
远程分支是远程的。
您向它们推送,或者从它们获取。
但你不推送远程分支。
类似
+refs/heads/*:refs/remotes/origin/*
的 refspec 对于 git Push 只会将所有本地分支推送到各自具有相同名称的远程分支。如果您有其他远程分支想要推送到最终的上游存储库,则需要首先在本地签出这些分支,然后推送它们。
Remote branches are remote.
You push to them or you fetch from them.
But you don't push remote branches.
A refspec like
+refs/heads/*:refs/remotes/origin/*
for git push would simply push all the local branches to their respective remote branches with the same name.If you have other remote branches you want to push to your final upstream repo, you need to checkout those branches locally first, then push them.