Don't be afraid to commit

Fear is one of the most powerful of emotions; it can drive a person to do the craziest things on Earth. One of the most common reactions to fear is the breakdown: you don't know what to do, so you end up doing nothing.

This is a common reaction even when you begin to use a new tool like Git, where gaining confidence can be difficult; because of the fear of making a mistake, you don't commit until you are obligated. This is the real mistake: being scared. In Git, you don't have to be scared; maybe the solution is not obvious, and maybe you have to dig on the internet to find the right way, but you can get away with small or no consequences, ever (well, unless you are a hard user of the --hard option).

On the contrary, you have to make the effort to commit often, as soon as possible. The more frequently you commit, the smaller your commits; the smaller your commits, the easier it is to read and understand the changelog, and the easier it is to cherry-pick commits, and do code reviews. To help myself get used to committing this way, I followed this simple trick: write the commit message in Visual Studio before starting to write any code:

Try to do the same in your IDE or directly in the Bash shell, it helps a lot.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.184.90