I’m using gitflow branching model for some projects. For this reason when someone clone a repository I’d like that the default checked out branch would be the develop branch rather than master.
For public projects hosted on Github I can control this using the Admin section for that repository, but for private repository managed with gitolite the only working solution I found is to ssh into the hosting machine and use the git update-ref command directly in the bare repository.
Is there any way to do this remotely, i.e. without the need to ssh into remote machine?
After a couple of hours spent in implementing VonC suggestion I sadly found out that a
set-headscript already exists in gitolite repository 🙁However I’ve already implemented my version for that so I’m posting it here. I implemented an additional feature which can restrict the set-head command only to repository creators. Maybe I will fork the gitolite project and add that feature to the original version.
BTW here is my version:
Here it’s the pull request if someone is interested