7 ways to make Git work better for your team

      2 min read          

This article is a continuation of my git workflow.

As your teams grow or shrink, there are practices that you can do with git that can make knowledge transfer more comfortable. Here is a list of things that you can do to make that process easier.

  1. Branch from master
  2. Only keep branches that are actively worked on
  3. Branches should be relatively short-lived
  4. Merge master to your branch regularly if it exists longer than a few days. Doing this helps to avoid merge conflicts later
  5. Periodically remove branches that have been merged to master. Automate it if you can
  6. If your branch is related to work tracked in a system (Jira, Monday, etc.), consider including that system number along with the human-friendly description
  7. Use pull requests when merging branches to master to share knowledge with team members. And perhaps catch something overlooked.

Below are some git commands to help make these things easier.

DescriptionCommand
branch from mastergit checkout master; git checkout -b jira-1234-something-awesome
merge master to your branchgit checkout jira-1234-something-awesome; git fetch --all; git merge master
Removing branches merged to masterSee my git workflow post
Submit Pull requesthub pull-request -r codeninja,techgoddes -b master

Additional Notes

Disagree? Did I miss something? Comment below or you can Tweet me with #git .
comments powered by Disqus