Git-Flow: warn if committing to master branch

Howard 3 years ago updated by Marc Strapetz 3 years ago 0

When working on a new feature or fix my expected work flow is to pull the base branch (master, develop, etc.) then create a new feature or hotfix branch, make the changes and commit them to the new branch.  Then a peer review or pull request is made for other developers to review the changes before they get merged back into the base branch.  However sometimes when working on some new code I forget to create the new branch. When I finish the change and commit it, it gets committed back to the base branch directly.  This is bad since is skips the peer review step.

It would be very nice if I could configure SmartGit to warn me if I am attempting to commit a change to a base branch (in my case that would be the master or develop branches).  That warning would remind me that I forgot to create a new branch before doing the commit, and would help be to avoid occasionally forgetting to create the new branch, and mistakenly committing changes directly to the base branch.