diff --git a/git/.config/git/config b/git/.config/git/config index c978251..4114922 100644 --- a/git/.config/git/config +++ b/git/.config/git/config @@ -10,6 +10,7 @@ [alias] ignore = "!gitignore -f" pushmerge = "push -o merge_request.merge_when_pipeline_succeeds" # see https://docs.gitlab.com/ce/user/project/push_options.html#merge-when-pipeline-succeeds-alias + last = "diff HEAD HEAD~" [commit] # sign commits as me gpgsign = true diff --git a/git/.config/sh/alias.d/git.sh b/git/.config/sh/alias.d/git.sh index 0d260bb..6d766c8 100644 --- a/git/.config/sh/alias.d/git.sh +++ b/git/.config/sh/alias.d/git.sh @@ -28,10 +28,15 @@ alias gds='git diff --staged' alias gi='git ignore' -alias glog='git log --stat' +# show last committed content +alias gll='git last' +# show quick log overview alias glg='git log --oneline --decorate --graph' alias glga='git log --oneline --decorate --graph --remotes --all' -alias glgp='git log --stat -p' +# show detailed log overview +alias glog='git log --stat' +# show detailed log overview with contents +alias gloog='git log --stat -p' alias gf='git fetch' alias gl='git pull' @@ -68,4 +73,3 @@ esac alias gstp='git stash pop' alias gstl='git stash list' alias gstL='git stash list --stat' - diff --git a/git/README.md b/git/README.md index 8f62a94..1c38319 100644 --- a/git/README.md +++ b/git/README.md @@ -13,8 +13,8 @@ I sign all my commits by default, so take out the corresponding lines if you don Git will rewrite any remotes using http(s) to use the ssh notation for pushes to github and gitlab so that, even if you set up the repository using an https url you can utilize your usual ssh key for pushing. -Finally, the configuration makes use of a custom pager called `dsf` which is also contained in this module. -It tries to use `diff-so-fancy` if that is installed on the path, otherwise uses git's internal diff prettifier. +Finally, the configuration makes use of a custom pager called `dsf` which is also contained in this module. +It tries to use `diff-so-fancy` if that is installed on the path, otherwise uses git's internal diff prettifier. If nothing exists it falls back to the standard output. You can move between changed files in diffs with n/N. @@ -24,9 +24,13 @@ Otherwise, the git config is prepared to handle lfs repositories, and it has an This module contains a heap of aliases to every-day git commands. Most of them follow a two-to-three letter combination of things to do which corresponds to the mnemonic of the longer git command. -As such, they are mostly similar to those found in the Oh My Zsh [git plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git) +As such, they are mostly similar to those found in the Oh My Zsh [git plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git). Examples of some common aliases are `alias ga=git add`, `alias gst=git status`, `alias gp=git push`, `alias gl=git pull`. +Two aliases might be of note: +`gi` allows quickly generating a gitignore file for the current directory, using the included `gitignore` script. +And `gll` quickly pulls up the contents of the last commit. (`ll` since `gl` already pulls from the remote) + ## Gitignore generation script Adds a `gitignore` script which pulls relevant .gitignore lines from [gitignore.io](https://www.gitignore.io) and sends them to standard out, or creates a .gitignore file in the current directory.