mirror of https://github.com/nirenjan/dotfiles.git
Add Git commit template
This configures Git to use a standard commit template, in order to make it easier to write better commit messages. This commit adds a default template, and configures Git to use it as the default. It also modifies the install script to install the default template at ~/.git-commit-template. Finally, this adds an extra check to reapply the committed Git configuration to the global Git config.master
parent
d2f9c5cdc7
commit
65fb291da3
|
@ -0,0 +1,12 @@
|
|||
# If applied, this commit will...
|
||||
|
||||
# Why is this change needed?
|
||||
Prior to this change,
|
||||
|
||||
# How does it address the issue?
|
||||
This change
|
||||
|
||||
# Provide links to any relevant tickets, articles or other resources
|
||||
|
||||
# Template sourced from
|
||||
# https://codeinthehole.com/tips/a-useful-template-for-commit-messages/
|
|
@ -37,6 +37,8 @@
|
|||
co = checkout
|
||||
ci = commit
|
||||
st = status --short --branch
|
||||
[commit]
|
||||
template = ~/.git-commit-template
|
||||
[url "git://github.com/"]
|
||||
insteadOf = gh:
|
||||
[url "git@github.com:"]
|
||||
|
|
11
install
11
install
|
@ -132,6 +132,12 @@ echo Installing dotfiles from $PRINT_PATH
|
|||
#######################################################################
|
||||
# Install git configuration
|
||||
#######################################################################
|
||||
if [[ ! -e ~/.git-commit-template ]]
|
||||
then
|
||||
echo "Installing Git commit template"
|
||||
cp -v gitcommit ~/.git-commit-template
|
||||
fi
|
||||
|
||||
if [[ ! -e ~/.gitconfig ]]
|
||||
then
|
||||
echo "Installing gitconfig"
|
||||
|
@ -142,6 +148,9 @@ then
|
|||
read GIT_EMAIL
|
||||
git config --global user.name "$GIT_USER"
|
||||
git config --global user.email "$GIT_EMAIL"
|
||||
else
|
||||
echo "Applying gitconfig"
|
||||
./scripts/applygitconfig gitconfig
|
||||
fi
|
||||
|
||||
# Install git prompt functions
|
||||
|
@ -177,7 +186,7 @@ if [[ -d .git ]]
|
|||
then
|
||||
git pull
|
||||
else
|
||||
git clone git@github.com:nirenjan/vimfiles.git .
|
||||
git clone my:vimfiles.git .
|
||||
fi
|
||||
|
||||
git submodule init
|
||||
|
|
Loading…
Reference in New Issue