Title: GIT for TomEE Developers
###The GitFlow Workflow
Notes before you begin (mostly for SVN users):
Run commands in the directory of the project you are working on, for example ‘tomee’:
Always create a feature branch from develop using an ‘extremely’ descriptive name, this should usually be the JIRA id or task name you want to work on:
git checkout -b TOMEE-007 develop
Switched to a new branch ‘TOMEE-007’
git status
nothing to commit, working directory clean
Immediately push the new branch to the repository so everyone can see it remotely (and possibly collaborate):
git push -u origin TOMEE-007
Branch TOMEE-007 set up to track remote branch TOMEE-007 from origin.
Once that is done then you just need the simple push for subsequent calls on this branch:
git push
Work like mad on the JIRA issue calling commit and add as often as you like...
If others are working on your branch also remember to pull their changes (Or just as good practice):
git pull
git commit
git push
Finally, to push the completed (or significant non-breaking progress on the) feature to develop at any time (ensuring develop is up to date first):
git pull origin develop
git checkout develop
git merge --no-ff TOMEE-007
Once the completed feature is merged and the JIRA resolved then the branch can and ‘should’ be deleted before pushing:
git branch -d TOMEE-007
git push origin develop
Now we have learned to do it the hard way, time to look at the simplified version. The GitHub native tools!
For the latest mac version go here: Mac Latest,
And windows here: Win Latest
These tools will probably not save you much time over the command line, but provide a much better visualization of ongoing processes.
The steps are and remain as described above:
*Note: You can actually merge the current develop (or any other ‘synchronized’ branch) into your branch first to make sure it is stable,i.e. ‘develop’ + ‘TOMEE-007’ = ‘TOMEE-007’ - This is really cool!