Monday, May 4, 2015

Git Branching Model

In Git version control system we can maintains multiple branches. For this example lets take Master branch and Development Branch.
  • Master Branch
This branch contains the most recently released Carbon Kernel. This is the main branch where the source code of HEAD always reflectsproduction-ready state.
  • Development Branch 
This branch is the main branch where the HEAD always reflects a state with the latest on going trunk development changes for the next release.

Start working on new feature

When you start to work on a new feature, you can create a separate feature branch for your self from the develop branch and start working. You can then merge your changes to the development branch once you complete the feature. The following instructions will guide you to start.


Task
Command
Description
Commit your changesgit commit -a -m "your commit message"Committing your changes to your local git repository
Creating a feature branchgit checkout -b myfeature developmentYou can create a new feature branch called myfeature from thedevelopment branch
Delete the worked feature branchgit branch -d myfeature
Incorporating changes to development branchgit checkout developmentThis will add your changes to your local development branch
Push the changes to development branchgit push origin developmentPush the changes to the central git repository under development branch


For more information visit http://nvie.com/posts/a-successful-git-branching-model/

No comments:

Post a Comment