Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging only modified files using Git

Tags:

git

I have a repository which contains Content & Source files. Developers should work only on source files. To save space, developers should not clone the content files (which are in GB) to their local repo. Source files are not present in the project as sub-modules rather they are in the same location where the contents are.

My approach is like this - I created a branch Source from Master and then deleted the content files from that branch. And I published the same branch for cloning to the developers.

As I am merging the changes from the Source branch back to Master, the content files are getting deleted in Master. How to restrict it? And if it is not possible then is there a way to achieve my requirement of having a separate branch / clone having only filtered files i.e. the source files in it?

like image 477
kaychaks Avatar asked Mar 01 '23 18:03

kaychaks


2 Answers

The obvious answer is that you should have separate source and content repositories. Or just leave the content be.

like image 122
Oddmund Avatar answered Mar 05 '23 14:03

Oddmund


You shouldn’t have removed the files from the Source branch at all. If Source and Master are only branches in the same repository your developers will have the content anyway; there’s no harm in having it lying around.

like image 42
Bombe Avatar answered Mar 05 '23 16:03

Bombe