How can I change the default comments in the git commit message?

There is commit.template configuration variable, which according to git-config(1) manpage: Specify a file to use as the template for new commit messages. “~/” is expanded to the value of $HOME and “~user/” to the specified user’s home directory. You can put it in per-repository (.git/config), user’s (~/.gitconfig) and system (/etc/gitconfig) configuration file(s).

Commit only part of a file’s changes in Git

You can use: git add –patch <filename> or for short: git add -p <filename> Git will break down your file into what it thinks are sensible “hunks” (portions of the file). It will then prompt you with this question: Stage this hunk [y,n,q,a,d,/,j,J,g,s,e,?]? Here is a description of each option: y stage this hunk for … Read more

What is a dangling commit and a blob in a Git repository and where do they come from?

During the course of working with your Git repository, you may end up backing out of operations, and making other moves that cause intermediary blobs, and even some things that Git does for you to help avoid loss of information. Eventually (conditionally, according to the git gc man page) it will perform garbage collection and … Read more

What is the Sign Off feature in Git for?

Sign-off is a requirement for getting patches into the Linux kernel and a few other projects, but most projects don’t actually use it. It was introduced in the wake of the SCO lawsuit, (and other accusations of copyright infringement from SCO, most of which they never actually took to court), as a Developers Certificate of … Read more