2

My colleague and I are working on a project. However, he is the main person in-charge of the project and I am developing a module which is a part of that project. I want to know if what I wish to do is possible and the steps on how do I go about doing it. I am using a self hosted GitLab.

1) I want to be able to push to my own git repo which does not contain the entire project.

2) At the same time I also wish to be able to push my changes to his repo which contains the entire project.

3) I only want to pull from my repo which does not contain the whole project.

I am still relatively new to git, I seek your patience.

Many thanks!

Raymond C.
  • 572
  • 4
  • 24

1 Answers1

1

You can't do that, point 2) go in conflict with 1) and 3).

The best solution for this kind of problem was this:

  • Push your project code on the main project repo.

  • Create a branch and develop on your project directory that is contained in the main project.

  • When you need to push some change on the main project you can merge the branch and restart.

In this way no if only you work on the your project directory, no merging conflicts are generated, and you can work easily, without every time see the all commit of your collegues on the main project.

Edit:

Another Solution can be the use of the Git Submodule, but for my opinion is too much for this simple problem.

Zig Razor
  • 3,381
  • 2
  • 15
  • 35