My practice Git Model
Thanks to this post. It get me more understand in Git.
Let’s have a try.
1. Create a new repo on Github
Your first commit to master branch
1 | git clone <your-project> |
2. Create a develop
branch
1 | # Branch out `develop` from `master` |
Now you have 2 branches in your Github
3. Now add a new module
1 | Branch out `module1` from `develop` |
4. Everything tested fine, merge to master
branch
1 | # Switch to `master` |
If you work on only a single branch, consider a situation here:
Now you have assigned a new module, you work on the new module. Suddenly, the life copy got some bugs that need you to be fix urgently, but now you’re working on the new module which is not yet complete.
Imagine the situation above happened, it may take you a lot of time to handle this. Thus use the branching model to avoid this situation happen.
Reference: A successful Git branching model