Change HEAD to point to not "master" for one repo

19 views
Skip to first unread message

Raymond Spence

unread,
May 2, 2023, 6:05:38 AM5/2/23
to gitolite
Hi All,

First I am not an expert in git or gitolite and second I have looked through
this google group for an answer to my question - if it is here I missed it.
My team has complete privileged access to the host with gitolite. We can
edit any file. I simply want to change the default branch for one existing
repository. (The Team would then re-check out that repo with the goal that
our local copies would then be based on the new non-master branch..) 
My understanding is that this is set in the HEAD file for that repo. If I manually
edit that HEAD file to point to the desired non-master branch will this correctly
set what I'm looking to change? If not, as we can execute anything as root, or
any user, what would then be the correct command to make this change? We
do not have symbolic ref enabled. Is that necessary?

Many thanks,
Ray
 

Sitaram Chamarty

unread,
May 2, 2023, 6:13:57 AM5/2/23
to Raymond Spence, gitolite
Hi Raymond

`git symbolic-ref` should be the command you need. Since you
have access to the server you can just run that command directly
in the repo in question. (I think you first create your new
branch using `checkout -b` or similar, then run the
symbolic-ref).

"enabling" symbolic-ref (by editing ~/.gitolite.rc on the
serveer) is only needed if you want to allow this action to be
performed by a *gitolite* user (i.e., a user who does not
normally have shell access on the server)

regards
sitaram

salg...@gmail.com

unread,
May 2, 2023, 6:42:50 AM5/2/23
to gitolite
I am thinking that this is not gitolite specific; to that end, you should not limit your search for an answer only within this group....you have the entire internet to find an answer ;-)

Reply all
Reply to author
Forward
0 new messages