Git micro commits

Apr 12, 2015

Probably many of you have used Git, or SVN or both. If you didn’t use them then give Git a try and forget SVN, it will make your life easier. You can find the most popular git cloud repositories at GitHub and BitBucket. I’m not gonna waste your time with what is Git or SVN, you can read yourself and figure it out.

Now why I choose to compare micro commits vs large commits? Well, until recently I used a piece of software built on SVN. When it launched, probably was a very hot tool to use, but as time passes other tools come around and this one doesn’t satisfy your needs at full. Using SVN for a few years now I couldn’t branch. The tool had the option to branch but it was a nightmare to use it so instead of ruining the whole repository I choose not to use it. So basically I was forced to commit and push only after my code was done, tested and fully functional. Imagine working a week, or even more, adding more and more stuff to your solution and push everything into one massive chunk of code. For me it was a nightmare as if any of the code me or my team were pushing might need removal you have to remove the entire push. This is the story for mega commits.

Recently I decided to use git for my final year project. Some reasons behind this decisions involved a good branching system, more grained control over your code and your work and very easy rollback in case of mistakes. Usage of a new system came with the specific learning curve and after I got used with using it I forgot about the old SVN system. What is interesting is that when you learn a similar technology you tend to use your old habits with it and not be aware of some of the advantages. This happened to me as even having all the advantages of git I kept commiting and pushing after all the work has been done. While working on my Android project I had a git issue that involved adding activities, classes, creating data models and changing other existing ones so I started to commit after each change. For example when I added a class, an activity or an xml file I commited. Then I realized that this is a more efficient way to commit my work as I could see better commit messages and cherry pick commits. Also my commit messages are more specific and my final one will close the GitHub issue I was working on.

This is one day of work:

image

The tool I use to manage my repositories is called SourceTree and is free.

Tags: programminggit

Archives

  1. January 2025
  2. The Cost of Slow Pipelines - A Tale of Wasted Time
  3. December 2024
  4. Keeping Software Simple to speed up Software Development
  5. October 2024
  6. The Kanban Café - A Story of Flow
  7. A Story on Accidental Complexity in Software Development
  8. February 2024
  9. Maximizing Software Development Productivity: The Power of Flow and Minimizing Interruptions
  10. December 2023
  11. Clean Code in Java: Writing Code that Speaks
  12. Clean Code in Java: A concise guide
  13. Understanding Value Objects in Java: A Brief Guide
  14. August 2023
  15. Must Have on Message Payload
  16. Centralised Management System For Message Schemas
  17. Consuming RabbitMQ Messages with Clojure: A Step-by-Step Tutorial with Tests
  18. January 2023
  19. Running a Spring Boot service with kubernetes
  20. December 2022
  21. Hosting a PWA with Jekyll and Github pages
  22. November 2022
  23. Global Day of Code Retreat
  24. Facilitating a mini Code Retreat
  25. October 2022
  26. The Curse of Optional
  27. September 2022
  28. Testing Spring Boot Microservices - Presentation
  29. March 2022
  30. TDD Workshop
  31. February 2022
  32. Value Objects in Java
  33. Efficient Java
  34. January 2022
  35. Spring Boot testing - Focus on your changes
  36. Product users - Personas
  37. December 2021
  38. Write code fit for testing
  39. November 2020
  40. Running a Spring Boot app with kubernetes
  41. September 2019
  42. Setup GPG on Mac and sign git repositories
  43. July 2019
  44. Running a Clojure Pedestal application on Raspberry Pi model B revision 2
  45. Clojure from zero to hero (part 3) - First endpoint
  46. Clojure from zero to hero (part 2) - A bit of syntax
  47. June 2019
  48. Clojure from zero to hero (1) - explaining project.clj
  49. Clojure from zero to hero (0) - creating a Pedestal app
  50. November 2017
  51. Introduction to Docker
  52. April 2015
  53. Git micro commits
  54. July 2014
  55. Google Glass Development - setup tools, environment and turn on debugging on Glass
  56. June 2013
  57. How To: Get the rendered HTML of a webpage with Python
  58. Set union of two lists in Python