title |
---|
Git configuration for ~/.config/git |
This repository is intended to be cloned as ~/.config/git
:
$ cd ~/.config/
$ git clone 'https://github.com/s5k6/git_config' git
Create a file ~/.config/git/config
and include ./config.tracked
from there:
$ cat <<. >config
[include]
path = config.tracked
.
This construction is chosen on order to separete site-specific
configuration from configuration which should be actually tracked.
Git may modify the file ./config
.
See config section [alias]
:
-
lg
gives a very compact log and graph.latest
shows then the latest commit occurred. -
dw
,di
ordf
show diff with granularity of file, line or word. -
ff
fast-forward merge if possible, or fail. -
Simple abbreviations:
st
=status
,sw
=switch
. -
latest
lists branches ordered by latest commit date, newest at bottom. -
fixup
amends the last commit without changing the commit message.
Newly generated repositories are equipped with the following hooks.
They are enabled by default, by being listed in the file
.git/hooks/pre-commit
.
Hook script pre-commit.not-master blocks commits to the master
branch, except for the initial one. This encourages the workflow to
push to feature branches instead, and only merge into or fast-forward
to master
.
Hook script pre-commit.violations runs the test scripts listed in the violations directory, passing the path as 1st argument, and the file's contents on stdin.