From 02644b5e121a4b17fb0697159cfaccdf16e1e0d5 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 23 May 2021 21:52:26 +0200 Subject: Add the locked/lock/unlock git aliases and remove unused aliases This is based on the awesome work in git-extras Ref: https://github.com/tj/git-extras/blob/master/bin/git-locked Ref: https://github.com/tj/git-extras/blob/master/bin/git-lock Ref: https://github.com/tj/git-extras/blob/master/bin/git-unlock I don't need most of the other commands but these ones are pretty nifty and useful and quite hard to remember. --- .gitconfig | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to '.gitconfig') diff --git a/.gitconfig b/.gitconfig index aa5c1fc..ad85ca1 100644 --- a/.gitconfig +++ b/.gitconfig @@ -23,13 +23,11 @@ co = checkout cm = commit --verbose ls = log --oneline --decorate - la = log --oneline --decorate --numstat lg = log --oneline --graph - ; ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative - ; fl = log -u ldf = diff --cached HEAD^ - wdf = diff --color-words --word-diff-regex='[A-z0-9_]+|[^[:space:]]' - ; up = "!git remote update -p; git merge --ff-only @{u}" + locked = "!sh -c \"git ls-files -v | grep ^S | sed -e 's|S ||'\" -" + lock = "!sh -c \"git update-index --skip-worktree $1\" -" + unlock = "!sh -c \"git update-index --no-skip-worktree $1\" -" [push] default = current [pull] -- cgit v1.2.3