user1409508
user1409508

Reputation: 623

Where should I init Git repository?

I have started using git, read few tutorials, but I still don't know what is a proper way to use it? Where should I init my repository?

Let's say I have following project

my_project
    - modules
        - module_a
            - controller
                feature_a_controller
                feature_b_controller
            - model
                feature_a_model
                feature_b_model
        - module_b
            - controller
                feature_a_controller
                feature_b_controller
            - model
                feature_a_model
                feature_b_model
    - public
        - js
            script.js
        - css
            style.css

1.
I would like to have separate history for each module, so I should init repository in module_a and module_b, but each module may have public files like javascript or css. As far as I know you can't add files to repo from outside directory, so should I init repository in my_project directory?

2.
Let's say I'm currently working on module_a, should each feature(controller+model) have own branch?

Or maybe I should init repository in my_project and each module (module_a and module_b) should have their own branch?

All these possibilities get me confused

Upvotes: 0

Views: 70

Answers (2)

Anshul Bisht
Anshul Bisht

Reputation: 1654

Initialize the repository in my_project folder. Make separate branches for module_a and module_b

Upvotes: 0

saurabh
saurabh

Reputation: 6775

You should init in my_project and change module_a and module_b in separate branches, and keep pushing to master/develop. Check this for branching model.

Upvotes: 1

Related Questions