I want to create a new work branch in gitlab. I want to be the admin of that branch. Please, someone help me learn how to create my own branch in Gitlab and keep my projects on that work branch...
4 Answers
From the command line:
git checkout -b <branch_name>

- 1,070
- 7
- 25
-
1`-b` to create and switch to the branch_name – m3asmi May 15 '18 at 15:17
GitLab integration with Gitolite is mainly at the project level, to register users to project (only if said users have registered a public ssh key, otherwise, they won't even appear in the gitolite.conf
file)
So for branch access, like personal branches, you need to have access to gitolite-admin project, clone that project and modify the gitolite.conf
yourself.
But even if you do, you won't see a graphical representation of that special Gitoite right in GitLab.
Even in its latest version (I am running a 3.2.0pre ff9a2e2, a commit from November 28th).
Personnal branches on Gitolite:
"personal" branches are great for environments where developers need to share work but can't directly pull from each other (usually due to either a networking or authentication related reason, both common in corporate setups).
Personal branches exist in a namespace of their own. The syntax is
RW+ personal/USER/ = @userlist
where the "
personal
" can be anything you like (but cannot be empty), and the "/USER/
" part is necessary (including both slashes).A user "
alice
" (if she's in the userlist) can then push any branches inside personal/alice/. Which means she can pushpersonal/alice/foo
andpersonal/alice/bar
, but NOTpersonal/alice
.
Where it gets complicated is that GitLab won't register 'alice
' (named after your public key alice.pub
.
When GitLab receives your public key, it will create a public key file (stored in the gitolite-admin/keydir
) named (for instance)... alice_mail_com_123456789.pub
.
That is:
- alice email
- a timestamp (according to an edit by an "anonymous user": it is not, as I initially thought, a
generated random id)
So you need, in your custom rules that you add to your gitolite.conf
, to reuse that specific "GitLab" name.

- 1,262,500
- 529
- 4,410
- 5,250
-
Thanks for your fast reply @VonC. I visted https://github.com/gitlabhq/gitlabhq/blob/stable/doc/install/installation.md from that they specify to install some software package. Please check that link and let me know whether it is rite??? – Bathakarai Nov 30 '12 at 06:53
-
@Bathakarai that is a different question, namely: "How to install GitLab?". My answer was to point out that you can declare personal branches with Gitolite, without using GitLab. You actually can manage your repos without GitLab, while still using Gitolite. If you have issue installing GitLab, then ask a new question (specifying your environment and what you have tried, and what your error messages are). Otherwise, yes, you need to install packages first. That is right. – VonC Nov 30 '12 at 07:02
-
Okay @VonC, I am not clear about Gitolite. Actually what it is?? Send any link to learn abt it.. – Bathakarai Nov 30 '12 at 07:16
-
@Bathakarai good question. Gitolite is an **authorization layer**: http://sitaramc.github.com/gitolite/auth.html. See http://sitaramc.github.com/gitolite/index.html#what and http://sitaramc.github.com/gitolite/why.html – VonC Nov 30 '12 at 07:28
-
@Bathakarai As I details in http://stackoverflow.com/questions/5683253/distributed-version-control-systems-and-the-enterprise-a-good-mix/5685757#5685757, Git itself has no authorization (anyone with an access to a Git repo can read/write anything). Gitolite is a layer which allows to control who access what. There is no GUI, just a script which intercepts git commands and your id, and allows or denies said git command. GitLab is a Git repo manager, a GUI to show the teams, the projects, like GitHub. – VonC Nov 30 '12 at 07:31
-
@Bathakarai GitLab uses Gitolite for its access manager. Note that GitHub doesn't use Gitolite, and has its own authorization layer internally. Both projects (GitLab and Gitolite) are developed independently: GitLab uses Gitolite services. Gitolite doesn't even know that GitLab exists. – VonC Nov 30 '12 at 07:32
-
-
-
when i install Gitolite the following error occures error: unknown option `dirty=-dt' usage: git describe [options]
* --contains find the tag that comes after the commit --debug debug search strategy on stderr --all use any ref in .git/refs --tags use any tag in .git/refs/tags --long always use long format --abbrev[= – Bathakarai Nov 30 '12 at 09:32] use digits to display SHA-1s --exact-match only output exact matches ...etc -
@Bathakarai ok that is a new question. Do mention the process you are using to install Gitolite, your OS, the version of your OS and of Git, and other relevant details. I will check that in your new question (rather in comments) – VonC Nov 30 '12 at 09:44
-
when i run "gitolite setup -pk bathakarai.pub" command i got "bash: gitolite: command not found" error message. Please tell me where the problem is?? – Bathakarai Nov 30 '12 at 11:36
-
Looks like Gitlab [no longer depends on](https://about.gitlab.com/2013/02/12/gitlab-without-gitolite/) Gitolite. – jpaugh Sep 07 '17 at 20:17
-
I think what you mean is how to fork a project on gitlab. You do this by clicking a 'fork' link in upper right part of the UI

- 61,444
- 9
- 118
- 120
Issue the following command in your terminal:
git branch yourbranchname
To check for how many branches available in our git project type:
git branch

- 59
- 3
- 11
-
1I'm sorry but this answer is terrible. Can someone format it. I can't tell where the comments end and the code begins. – puk Aug 20 '15 at 18:12