Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Git: Why is it good to commit often? [closed]

So I'm quite new to Git and DVCS in general, and I've been reading everywhere that, at least on private branches, "it is always good to commit all the time". The question is: why? I am using SourceTree (Git client with graphical interface) and I find it much easier to (stage and then) commit my code once everything is working and I'm done, since I can still see my diffs in SourceTree before committing.

So what's the reason for committing more often? And how often should I do it?

like image 675
modellero Avatar asked Oct 19 '22 16:10

modellero


1 Answers

The idea behind committing often is to sort of create a live feed for yourself of changes. I think it's also a safeguard in case you make a small change in your code, and something goes wrong and you lose the version you were working on. That way it reduces the necessity for human memory, and relies on (redundant) computer storage instead.

like image 118
Josh Beam Avatar answered Oct 22 '22 21:10

Josh Beam