Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT Branch Specific Files?

I am wondering if it is possible to say have a main repo with everything I need, config, application code, etc. (This is a MVC environment) and create branches from a main GIT repo with just certain models,controllers,and views.

So I would have a main repo with

applications/*
assets/*
system/*

And I would have a branch with

applications/controllers/controller_name.php
applications/model/model_name.php
applications/views/view_name.php
assets/modules/controller_name/*

Then I could merge that branch into the main repo for each new "MVC setup"

Does this make sense? And can it be done?

like image 296
Steven Avatar asked Mar 03 '12 23:03

Steven


1 Answers

Git does not branch on a per-file basis, it branches on a repository basis.

That said, just because you make a branch with the entire repo doesn't mean you have to have all of the same files in each branch.

like image 65
Amber Avatar answered Sep 23 '22 03:09

Amber