https://marketplace.eclipse.org/content/gitflow-nightly --> Drag and drop in the eclipse workspace.
Overview:
To learn about gitflow branching concepts, check Understanding GitFlow
2 Initialize GitFlow:
To Clone your git repository in eclipse, check Installing and Cloning git repository in Eclipse Once you've your repository in eclipse, go to Git perspective and right click on your project and click on "Init Git Flow".
Select default values by clicking "OK". Now you’ll be on develop branch. (For now develop
branch is just in local repository not in remote). Developers can start their coding by creating
their own feature based on develop.
The purpose of feature branch is that, it should have small unit of work which should last for few hours or days but not weeks or months. With gitflow, you can work on multiple features simultaneously.
3 Start Feature:
To start a feature, right click on project --> Git flow --> Start feature. Provide
a name for the feature.
Now as you can see in the project view, you're on feature branch now. At this point, you can use normal git commands to commit your code. To learn about Git, check Git. Now if you need to collaborate with other team members for the feature you created, you can publish the feature to remote repository so that other team members can use it.
3.1 Publish Feature:
In Git perspective, right click on the project --> Git flow --> Publish Feature.
Now, your feature branch is pushed to remote repository and other team members can look into your feature.
3.2 To get Published feature:
Now, your feature branch is pushed to remote repository and other team members can look into your feature.
3.2 To get Published feature:
Right click on project --> click on gitflow --> fetch feature.
Once feature is ready you need to merge back into develop branch using “Finish Feature”
3.3 Finish Feature:
Once you complete working on our feature, it’s time to merge it back with the main develop branch.
In Git perspective, right click on the project --> Git Flow --> Finish Feature. You’ll see “Feature Finish Options” dialog box.
Select option #1 (Squash - produce a single commit from the changes in this feature)
Reason to select option #1:
Once feature is completed, you don't want those
feature branches as it will lead to confusion when number of feature
branches increases. Once feature is completed it’s good to merge into develop
and delete it, so you’ll know that feature is completed.
If you’ve not committed your feature changes, it’ll ask you to "commit, stash or discard changes by resetting the current branch".
When you select commit, provide comment and click on commit
and push to publish feature changes into remote repository. At this point,
- · Feature branch 'feature/Demo-AddingFeature' was merged into 'develop'
- · Feature branch 'feature/Demo-AddingFeature' has been locally deleted
- · You are now on branch 'develop'
Now that you merged your feature code into develop branch and
deleted feature branch locally, you can now go ahead and delete feature
branch from remote as you’re done with that feature implementation.
3.4 Delete feature branch
from remote:
In Git perspective, right click on project --> Remote --> Push.
Enter the destination repository location --> Click “Next.
Select the branch name and click on “x Add Spec”.
Click on “Finish”. Now feature branch is gone from remote repository.
Once you merge your feature branches into develop, you can now push
develop branch to remote.
Push develop to
remote:
In Git perspective, right click on project --> Push branch develop.
4 Creating Release Branch:
Once you merge all your features into develop branch and once develop branch is stable, you are ready for code release.
4.1 Start Release Branch:
In Git perspective, right click on project --> Git flow --> Start Release. Provide name for the release “2016-05-12.0”
Now, new branch 'release/2016-05-12.0' was created, based on
'develop' and you’re on release branch now.
Zero after decimal is the increment for the release. Release branch is created off of develop branch. Once you create release branch you need to publish it, so QA can take the code and do some testing.
4.2 Finish Release
Branch:
Right click on project --> Git flow --> Finish Release.
Release branch 'release/2016-05-12.0' has been merged into
'master'
- The release was tagged '2016-05-12.0'
- Release tag '2016-05-12.0' has been back-merged into
'develop'
- Release branch 'release/2016-05-12.0' has been locally
deleted; it has been remotely deleted from 'origin'
- You are now on branch 'develop'
Above command will merge release into develop and master and tag the
release and delete release branch locally.
Things to do now:
- · Push local develop branch to remote as release branch merged its changes to develop branch.
- · Git flow will not push your tags into origin. You need to push tags into remote repository.
- · Delete release branch from remote repository.
Push local develop branch to remote:
Right click on project --> Push branch develop.
Push tags into remote repository:
Right click on project --> Remote --> Push Tags.
Delete release branch from remote repository:
Right click on project --> Remote --> Push.
Enter the destination repository location --> Click “Next.
Select the branch name and click on “x Add Spec”.
Click “Finish”.
5 Creating HotFix Branch:
HotFix branch is similar to release branch, but only difference is that hotfix branch is created off of master branch where as release branch is created off of develop branch.
5.1 Start HotFix Branch:
Right click on project --> Git flow --> Start Hotfix.
Provide a name “2015-06-20.0”
- A new branch 'hotfix/2015-06-12.0' was created, based on
'master'
- You are now on branch 'hotfix/2015-06-12.0'
Make changes and then commit them. When you commit them, a
new hotfix branch will be created in remote repository.
Once you’re done with making changes, finish hotfix.
5.2 Finish Hotfix:
Right click on project --> Git flow --> Finish Hotfix.
- Hotfix branch 'hotfix/2015-06-12.0' has been merged into
'master'
- The hotfix was tagged '2015-06-12.0'
- Hotfix tag '2015-06-12.0' has been back-merged into
'develop'
- Hotfix branch 'hotfix/2015-06-12.0' has been locally
deleted
- You are now on branch 'develop'.
Things to do:
- · Push local develop branch to remote as Hotfix branch merged its changes to develop branch.
- · Git flow will not push your tags into origin. You need to push tags into remote repository.
- · Delete Hotfix branch from remote repository.
Push
local develop branch to remote:
Right click on project --> Push branch develop.
Push
tags into remote repository:
Right click on project --> Remote --> Push Tags.
Delete hotfix branch from remote repository:
Right click on project --> Remote --> Push.
Enter the destination repository location --> Click “Next.
Select the branch name and click on “x Add Spec”.
No comments:
Post a Comment