Mastering Master

Always remember that Github makes it very difficult to delete work.

When working on a group/team project, take advantage of the wonderful tools that you are provided with. Github is a form of version control that inspires fear in many first time users. Think of Github as a protector rather than as a bully. Additionally, don’t let Github turn you into a bully.

Here are some tips on mentally preparing to approach Github and some strategies for taming your inner Octocat.

ON MENTAL PREPAREDNESS

  1. If you wrote it once you can write it again.
  2. It’s not the end of the world if something bad happens, just take a deep breath and get back to work.
  3. Nothing bad will happen.
  4. If you are unsure of how to do something, look it up.
  5. If your search is unsuccessful, ask someone who knows.
  6. Don’t get mad at someone asking you for help, just don’t.

ON TAMING YOUR INNER OCTOCAT

  1. Avoid doing work directly on master. This can be done by branching.
  2. Create branches with specific purposes that are easily identified by their names. For example, ‘creating-foursquare-api-client’ would be a great branch name for a branch that creates the Foursquare API Client in a project. Once the file is created, merge to master, pull, and then pat yourself on the back before you branch from master to create a branch that is responsible for pulling in Foursquare data in the API Client you just finished creating.
  3. Branch small branches, and branch often. No active branch should be more than two days old before it gets merged.
  4. Avoid a broken master branch by running your code on your local branch and making sure everything works.
  5. Don’t break master.
  6. Don’t spend your time getting mad at yourself or anyone else for breaking master, just get it fixed. Make the person who broke master buy you coffee…NBD.
  7. Commit often, well, and clearly.
  8. Don’t ‘git add .’ if there are files that you don’t want to be added to the project.
  9. Make sure to git pull origin master (from master) before creating a new branch. Also, make sure that the master is working.
  10. Don’t break master.
  11. Don’t.
  12. If you do, see no. 6.

Keep in mind that Github is incredible at making sure you don’t screw up. Don’t be annoyed by the merge conflicts nor by the process of committing and adding and staging files; They are in place to insure your success. If you keep all this in mind, you may be able to successfully master Master.