DEV Community

Discussion on: Do you delete Git branches?

Collapse
 
rbukovansky profile image
Richard Bukovansky • Edited

The best practice would be:

  1. Name feature/bugfix branch having JIRA ticket # in name
  2. When committing don't put JIRA ticket # in commit message
  3. When done with development in that branch, merge it to master/develop branch, but make sure that JIRA ticket # is in merge commit message
  4. Delete the feature/bugfix branch

This will make sure that:

  1. During the development you know which branch is linked to that JIRA ticket
  2. Will not poison your commit messages with JIRA ticket #
  3. When merged the information about name of feature/bugfix branch and its JIRA ticket # is kept and still linked to JIRA
  4. That repo then can be brought to any different bug-tracking/repository hosting system without having it too linked to Atlassian stack. If this would be needed in future...