Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share a GIT branch without history? (Using GitLab)

Tags:

git

gitlab

I work on a private GitLab and I have multiple branches. I want to share a single branch with an external developer.

This developer is allowed to read or write on this branch only. He is not allowed to see the history of any of my other branches.

(I want to merge his work to my branches periodically.)

Is it possible to do this with GitLab?

Thanks in advance for your answer.

like image 502
Kcm Avatar asked Apr 29 '14 16:04

Kcm


People also ask

How do I give access to a GitLab branch?

Go to your project and select Settings > Repository. Expand Protected branches. From the Allowed to merge list, select a role, or group that can merge into this branch. In GitLab Premium, you can also add users.


1 Answers

You should be able to declare a new empty repo on gitlab, and add a remote url to your local repo.

That means:

  • you can push your branch to that second gitlab repo,
  • the other developer can clone that second repo and work with it,
  • you can pull from the second repo, and puqh to the first in order to update that shared branch.

The idea remains: you can protect branch against push (write), but not against read, hence the second repo.

like image 59
VonC Avatar answered Oct 16 '22 18:10

VonC