summaryrefslogtreecommitdiffstats
path: root/.gitconfig
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2021-05-23 21:52:26 +0200
committerAhmed Abdelhalim <[email protected]>2021-05-23 22:04:50 +0200
commit02644b5e121a4b17fb0697159cfaccdf16e1e0d5 (patch)
tree7ff01d7d7e08ddfcfe43d31cf9b1366a4639e311 /.gitconfig
parent0bc2f52f08a927765c5e0e4ead7568d820c16789 (diff)
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.
Diffstat (limited to '.gitconfig')
-rw-r--r--.gitconfig8
1 files changed, 3 insertions, 5 deletions
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]