当前位置: 动力学知识库 > 问答 > 编程问答 >

github - 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

网友答案:

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.

网友答案:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: