On Wednesday, October 9, 2013 11:16:38 PM UTC+2, cko wrote:

> hello people,
>
> I am currently working on a GIT workflow that is supposed to do the 
> following:
>
>
>    - there is one central repository named "puppet" - hosted on gitlab
>    - the repository is supposed to have three "fixed" branches: master, 
>    test and dev 
>    - the content of each branch is represented on the filesystem of a 
>    local server:
>       - branch master = /etc/puppet/modules/live 
>       - branch test = /etc/puppet/modules/test
>       - branch dev = /etc/puppet/modules/dev
>    - every developer is supposed to have his own copy of the "dev" 
>    branch. and should only be able to push to and pull from that branch (and 
>    selfmade branches).
>
>
> so the question is: how do i pull only a specific branch to the 
> filesystem? how do i protect the "fixed" branches from accidental pushes?
> is there any way to realize something like that?
>
>
You can protect repositories on the file-system the same way you would 
protected any folders, using posix accounts. If you want to do finer access 
control in a repository, you can use tools like gitolite, and probably 
GitLab has some support for this as well.

However, it seems you don't have a proper separation between the concepts 
of bare and non-bare repositories here. A repository manager like GitLab 
will store bare Git repositories, meaning they just contain the raw data 
(config, packfiles and pointers) of the repository, while a non-bare is 
what you typically use to work with all the files checked out in a 
work-tree. You cannot typically push to a non-bare repository. It usually 
belongs to someone else, and they use it for making their own commits. It 
would be weird if you could just shove your data into their repository. 
What the repository owner usually should do is to pull or fetch changes 
into their non-bare repo.

In your case, for the /etc/puppet repository/repositories, it should 
probably be owned by root, and should be controlled by some admin, who is 
free to pull in changes from the puppet repository in GitLab. It's pretty 
straight-forward to realize, we have a similar setup (although we don't 
bother with multiple branches for the puppet config).

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to