Support gitconfig with home-manager

- Migrate configuration from .gitconfig to home-manager.
- Delete .gitconfig.
- Delete .gitignore because I'm not using OSX anymore.
This commit is contained in:
William Carroll 2020-03-05 14:06:14 +00:00
parent 0cb1086adc
commit 3b689f03de
3 changed files with 21 additions and 28 deletions

View file

@ -15,6 +15,27 @@
path = builtins.toPath ~/home-manager;
};
programs.git = {
enable = true;
userName = "William Carroll";
userEmail = "wpcarro@gmail.com";
aliases = {
today = "! git log --date=relative --since=00:00:00 --all --no-merges --oneline --author=\"$(git config --get user.email)\"";
yday = "! git log --since=yesterday.midnight --until=today.midnight --oneline --author=\"$(git config --get user.email)\"";
changed-files = "! git --no-pager diff --name-only $(current_branch) $(git merge-base $(current_branch) master)";
conflicts = "! git --no-pager diff --name-only --diff-filter=U";
unstage = "reset HEAD --";
};
extraConfig = {
push.default = "current";
rebase = {
autosquash = true;
autostash = true;
};
rerere.enabled = true;
};
};
##############################################################################
# Services
##############################################################################

View file

@ -1,26 +0,0 @@
[user]
name = William Carroll
email = wpcarro@gmail.com
[alias]
recent = ! git for-each-ref --count=10 --sort=-committerdate refs/heads/ --format=\"%(refname:short)\" | fzf | xargs git checkout
today = ! git log --date=relative --since=00:00:00 --all --no-merges --oneline --author=\"$(git config --get user.email)\"
changed-files = ! git --no-pager diff --name-only $(current_branch) $(git merge-base $(current_branch) master)
conflicts = ! git --no-pager diff --name-only --diff-filter=U
yday = ! git log --since=yesterday.midnight --until=today.midnight --oneline --author=\"$(git config --get user.email)\"
patch-grep = log -p -S
unstage = reset HEAD --
appraise = ! $HOME/go/bin/git-appraise
[push]
default = current
[rebase]
autosquash = true
autostash = true
[remote "origin"]
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
[github]
user = wpcarro
[core]
excludesfile = ~/.gitignore
pager = less
[rerere]
enabled = true

View file

@ -1,2 +0,0 @@
# Mac
.DS_Store