Git-flow, Git gone smarter!!!

D3 Word Cloud : https://github.com/richavyas/D3-Charts

When we work in a team, where multiple people are working on the same codebase, it’s extremely important to follow a convention. Version control system , not a new thing, is obviously the way to handle that but the tools that i had used before would not be on top of the list when we talk about efficiency. Migrating from those to Git itself was such an upgrade. Git, the version control system, makes collaboration in a divergent and big team extremely organized. Lets say, Git-flow is a step ahead and is a layer on Git.

Some problems that I had with Git was it copying commits from other branches if not created from master or creating different forks and setting and synching remotes. In one line, Git-flow handles all that for you.

So are you saying that I don’t have to do all this:

  • No add upstream or Connect to the remote repository
  • No rebase, no fetch, no adding up stream

Then how am I supposed to synch, magically!!!!!

Image credit : http://blog.cambridgecoaching.com/

Yes because Git pull from develop branch gets you the latest. Its like 4 GIT commands vs 1 git-flow command

With git-flow, we don’t create forks, we all work on one centralized repo. Oh wait, what if you mess up the main repo. Ah, the beauty of Git flow is that you can’t. Because you still never touch master. You start a new branch which eventually gets merged with develop. The central repository is the official project and it takes care of managing conflicts really well. It doesn’t let you push something which can overwrite official commits.

Some norms to know about Git-flow:

  • There are two main branches: master & develop. These are your permanent branches.
  • Feature/feature-name only exists during feature development => gets deleted after integration into develop
  • hotfix/bug only exists for hotfix bugs in release code => gets deleted after integration into master

How do we run Git-flow on our mc

  • brew install git-flow
  • git flow init from develop branch
  • when you init, it edits your .git/config and prompts the below settings:
[gitflow “branch”]
master = master
develop = develop [gitflow “prefix”]
feature = feature/
release = release/
hotfix = hotfix/
support = support/
versiontag =

I let these be default.

  • git flow feature start FEATURENAME e.g. feature/some-component
  • git add
  • git commit
  • git flow feature publish FEATURENAME
  • adding more commits to already published branch -> git push
  • git flow feature track FEATURENAME
  • git flow release start RELEASE [BASE]
  • git flow release publish RELEASE
  • git flow release track RELEASE
  • git flow release finish RELEASE
  • git push –tags
  • git flow hotfix finish 1.2.1