In Git: Why is it good to do often?

So, I am completely new to Git and DVCS in general, and I read everywhere that, at least in private branches, "itโ€™s always useful to do all the time." The question is why? I use SourceTree (a Git client with a graphical interface), and itโ€™s much easier for me (step and then) to pass my code when everything works, and I finished, since I can still see that my differences in SourceTree are before committing.

So what is the reason to commit more often? And how often do I have to do this?

+5
source share
2 answers

The idea of โ€‹โ€‹committing often is to create a living channel for yourself to change. I think this is also a guarantee if you make a small change to your code and something goes wrong and you lose the version you were working on. Thus, it reduces the need for human memory and instead uses (redundant) computer storage.

+3
source

It is good to do often for the same reason that it is good to make frequent backups. Lock when you have code that you do not want to lose, say after a successful make check .

Unlike most centralized version control systems, such as Subversion or CVS, you can go back and polish the dirty history after your code is ready, but before you click or share it with the world, so git doesn't let you โ€œdo it right the first time. "

0
source

Source: https://habr.com/ru/post/1214146/


All Articles