• Home
  • Git
  • Programming
  • Leadership
  • About

Git Fetch Victor

Git, Programming and so much more...

Git the importance of a commit

Written by vjpudelski on March 16, 2016

Git is a system centered around the idea of a save point, a commit. When you use the source control software you create many commits throughout the life cycle of the application. These save points serve a number of purposes such as showing what you did to create a given issue, this would be if you tying the commit to a system like Jira to track issues. They can also show you who did which pieces of an application in a team setting as each commit is stamped with the user making the commit. Probably the most important purpose is to provide a history of the application and specifically the different files within the repository at any given point in the development process.

Why is this important, you ask?

Ever accidentally delete a file off your file system and go “oh crap, I didn’t mean to do that”. In some cases you can go to the trash can of your favorite OS and get the file back but what if you accidentally hit “empty trash” when you only meant to delete a single file? what then? In this case you are pretty SOL.

With Git if you accidentally delete a file or an entire directory from the repository but it was present in another commit, you can get it back. If you do a pull and the pull action overwrites a file that you really wanted your changes and not the ones from the server, you can get the file back. Not only that but you can get the file back as part of the merge process. No matter what happens in Git as long as there is a commit in the repository with the state of the file that you want, you can get to that file or directory again.

Now some will say committing too much is a bad thing. Don’t know why they would but I would highly recommend that you commit often. Especially as you complete features and functionality, I would commit. These save points, these commits, can be life saving later.

So, if you run into a situation where you think your repository is toast, trashed, totaled, … but you have a commit with the files you want, know you can get those back.

How do you get them back? … well that depends…

depends on the situation and as I come across different situations I will post about them so you can check my blog for solutions.

Posted In Git
Tagged git

Post navigation

PreviousHigh Resilience
NextMy Optimal Health

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Leaders Eat Last
  • Java calling .NET WebAPI
  • So What Really Mattered?
  • What really matters?
  • Has It Really Been Over a Year!

Recent Comments

  • Jason King on Has It Really Been Over a Year!
  • Sarah Dutkiewicz on Changing the Past
  • Dave Balzer on Team Culture
  • Sarah Dutkiewicz on Team Culture
  • Sarah Dutkiewicz on Impostor Syndrome, my dealings…

Archives

  • April 2019
  • February 2019
  • January 2018
  • October 2017
  • September 2016
  • August 2016
  • July 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • August 2015
  • January 2015

Categories

  • Git
  • Leadership
  • Non-Technical
  • Personal
  • Programming
  • Raspberry Pi
  • Reviews
  • Troubleshooting
  • Unstoppable Course

Tags

aspnet aspnetcore books coaching CodeMagazine cron csharp culture dotnet dotnetcore dreams git iPhone java management nike Nozbe Raspian rsync running samba server source control SubtleArtOfNotGivingAFck teams vscode web hosting

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright © 2025. Git Fetch Victor
Powered By WordPress and Auspicious