aboutsummaryrefslogtreecommitdiff
path: root/files/.gitconfig
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2020-09-20 17:37:48 +0500
committerAnton Bobov <abobov@gmail.com>2020-09-20 17:37:48 +0500
commit7494421ec6281de1ee7d327601223537b325a7a1 (patch)
treedd8d0da7152caafad34d00a7a54cc159c1ecc417 /files/.gitconfig
parent58200984aa4dff48d7925f48e443a00775c0ba07 (diff)
Updates.
Diffstat (limited to 'files/.gitconfig')
-rw-r--r--files/.gitconfig10
1 files changed, 10 insertions, 0 deletions
diff --git a/files/.gitconfig b/files/.gitconfig
index c26d10a..b2d308a 100644
--- a/files/.gitconfig
+++ b/files/.gitconfig
@@ -53,6 +53,11 @@
whoami = config user.email
fugitive = mergetool --tool fugitive
clean-branches = !sh -c 'git branch --merged | grep -v '^*' | fzf -m | xargs -rp git branch -d'
+
+ # Gitlab merge requests helpers
+ mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
+ mr-clean = "!git for-each-ref refs/heads/mr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
+
[advice]
statusHints = false
detachedHead = false
@@ -99,3 +104,8 @@
cmd = vim -c \"Gdiff\" \"$MERGED\"
[fetch]
prune = true
+
+# Allow pushing changes when working with a "read-only" remote from GitHub.
+[url "git@github.com:"]
+ pushInsteadOf = https://github.com/
+ pushInsteadOf = git://github.com/