Commit your source code often

Dev

Commit your source code often

When we first began using SVN a few years ago commits typically happened once a day, if that often.  Over time we have learned that fine-grained commits offer many benefits over bulk commits, I’ve outlined a few below.

Searching commits is easier

Committing more often means that you are putting log messages on a smaller amount of work.  If you commit a small CSS fix, you’re going to write in the log “Fixing such and such css error”.  If you make that CSS fix with many other unrelated fixes throughout the day, you are unlikely to list it in the log. Ideally, most commits should be tied to a bug/case # in your bug tracking tool of choice.

Less Conflicts

In a team environment, committing often is essential for avoiding conflicts when using a non-file-locking system like SVN.  If you don’t commit multiple times a day you may find yourself resolving many conflicts or other issues at the end of the day.  

File locking repositories seems to encourage bulk commits and less granularity in my experience.  It’s not uncommon to see entire projects and folders checked out for days or weeks in some of these environments.  These people see source code control as no more than source code backup and are missing out on the true value of scc.

Cleaner Code

How does source code control make code cleaner?  I’m sure you’ve either seen (or written yourself) code that has commented code blocks all throughout the code.  I did this in my younger days, but now it stands out as an eyesore.  There’s really no reason to check something in with commented out code in it.  If the code was previously in, then you should already have it saved to a previous revision which you can easily pull up and copy the old block of code as needed.

Less Missing Files

It’s pretty annoying when you are trying to compile a project and it turns out there is a missing file.  You have to figure out who committed the code and get them to figure out what files are missing and commit them.

If you are committing often and in smaller batches, you are less likely to forget all of the files you’ve had to add to the project.

The end result? Time saved.

Some people probably see committing often as a waste of time, but as with many things, the little bit of extra time you put into it winds up saving a lot of time when you don’t have to deal with all the headaches that can occur if you don’t commit often.  

More About the Author

Cole Shelton

Chief Data Officer
The Road to Tableau 2019.3: How InterWorks Influenced Server and Content Migration Features Tableau purchased Power Tools in 2019. Contact Us for more information. InterWorks fell in love with Tableau in 2008, and our Tableau ...
We’ve Improved Data Source Audit in Workbook Tools for Tableau! Tableau purchased Power Tools in 2019. Contact Us for more information. A little over a month ago, we released version 1.14 of our ...

See more from this author →

Subscribe to our newsletter

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072