7 Version Control Best Practices for Developers

April 13, 2018 Miikka Andersson

In my last post, Don’t Underestimate the Importance of Version Control, I outlined some of the basics of why version control is important. Version control saves versions of code which can then be reused, or in case of issues, applications can be reverted to older working versions. Popular version control solutions used today are Git, Subversion (SVN), Perforce and others. Version Control is vital at the enterprise software development level where you have a vast number of disparate teams. It is an every-day part of the developer’s routine, but also helps organizations achieve some high-level business goals such as increasing efficiency and improving quality and reliability of software.

Today I want to share some best practices for developers related to version control. These may seem like no-brainers, but after 15 years in the industry, you’d be surprised how many folks I’ve seen struggle to follow these guidelines. These tips benefit the developers by cutting down redundant work, increasing efficiency, and helping to prevent mistakes and errors. Following these tips will also promote teamwork and better collaboration as all of these habits make it easier for different people to work on the same code.

Best Practices for Version Control Users

  1. Make small changes. In other words, commit early and commit often. Of course, be careful not to commit any unfinished work that could break the build.
  2. Don’t commit personal files. These could include application settings or SSH keys. Often these are committed accidently but cause problems later down the line when other team members are working on the same code.
  3. Update often and right before pushing to avoid merge conflicts.
  4. Verify your code change before pushing it to a repository; ensure it compiles and tests are passing.
  5. Pay close attention to commit messages as these will tell you why a change was made. Consider commit messages as a mini form of documentation for the change.
  6. Link code changes to work items. This will concretely link what was created to to why it was created or changed by providing traceability across requirements and code changes.
  7. No matter your background or preferences, be a team player and follow agreed conventions and workflows. Consistency is important and helps ensure quality making it easier for team members to pick up where you left off, to review your code, to debug, etc.

Using version control of some kind is a must for any organization and following the guidelines above can help developers avoid needless time spent fixing errors and mistakes. These practices also help organizations reap greater benefits from having a good version control system. In my next post, I’ll provide some tips and best practices for organizations regarding version control. These tips will outline some ways that companies can ensure the workflow is optimal for ensuring quality and efficiency. Stay tuned!

Join me for a webinar titled “Enterprise Version Control – How to Deliver Customer Value at Speed,” to take a deeper dive into how version control can help you deliver value to customers.

About the Author

Miikka Andersson

Miikka Andersson, a Senior Product Manager at CollabNet, has over 10 years of engineering and project/product management experience in technology companies ranging from start-ups to large scale global enterprises. Miikka joined CollabNet from Microsoft / Nokia where he held various Project Manager, Product Owner and Technical / Team Lead positions. In addition to his strong Project and Product Management skills, he has a deep knowledge in Software Configuration Management, Test Automation, and Continuous Integration / Delivery. Being a huge advocate of Agile and Lean principles, he is very people-centric and constantly looking for new ways to improve work practices and processes. Miikka is a PMI certified Project Management Professional (PMP), Certified Scrum Master (CSM), and is also about to complete his Masters Of Science in Information Processing by the end of 2016.

More Content by Miikka Andersson
Previous Article
Version Control Best Practices for Software Organizations
Version Control Best Practices for Software Organizations

These best practices below are recommendations for the way software organizations can manage version contro...

Next Article
Top Agile & DevOps Trends from the 12th Annual State of Agile Report
Top Agile & DevOps Trends from the 12th Annual State of Agile Report

Here are some more themes and takeaways from the 12th annual State of Agile report: