git更改默认分支(gitolite) [英] git change default branch (gitolite)

查看:157
本文介绍了git更改默认分支(gitolite)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个分支库:master和devel。主是默认的。我想将master重命名为prod并将其设为默认值(并将其推送到服务器)。如何做到这一点?



存储库位于gitolite中(如果有的话)。 / div>

您需要访问服务器才能将HEAD的符号引用更改为您在其中推送的分支( prod )。 p>

  git-symbolic-ref HEAD refs / head / prod 

我试图在如何做到这一点我更改了一个Git远程HEAD,指向除master之外的其他东西,但是如果您可以直接登录到服务器,则更容易。

注意: 使用最新的Gitolite V3,您实际上可以运行该命令(参见非核心命令):

  / home / git / gitolite#gitolite symbolic-ref -h 

用法:ssh git @ host symbolic-ref< repo> < git-symbolic-ref的参数>

允许'git symbolic-ref'通过gitolite连接

通过一个ssh命令,你实际上可以改变HEAD以便由gitolite(V3)管理的远程回购站。



$ s $ git @ host symbolic- ref< repo> refs / head / prod


I've got a repository with branches: master and devel. Master is the default one. I want to rename master into prod and make it default (and push it to the server). How to do this?

Repository is hosted in gitolite (if it matters).

解决方案

You need to have access to the server in order to change the symbolic-ref of HEAD to the branch you have pushed there (prod).

git-symbolic-ref HEAD refs/head/prod

I tentatively proposed a way to do that from a client at the end of "How do I change a Git remote HEAD to point to something besides "master"", but it is easier if you can log on the server directly.

Note: with the latest Gitolite V3, you actually can run that command (see "non-core commands"):

/home/git/gitolite# gitolite symbolic-ref -h

Usage:    ssh git@host symbolic-ref <repo> <arguments to git-symbolic-ref>

allow 'git symbolic-ref' over a gitolite connection

So, through an ssh command, you actually can change HEAD for remote repos managed by gitolite (V3).

ssh git@host symbolic-ref <repo> refs/head/prod

这篇关于git更改默认分支(gitolite)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆