From b7b9224ae1482dfdb07f0d05835678a5c1d23bf9 Mon Sep 17 00:00:00 2001
From: Oscar Najera <hi@oscarnajera.com>
Date: Fri, 24 Jan 2025 12:29:04 +0100
Subject: checkout gitlab merge-requests

---
 home-dots/dot-gitconfig | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'home-dots')

diff --git a/home-dots/dot-gitconfig b/home-dots/dot-gitconfig
index cacdd3e..de999cf 100644
--- a/home-dots/dot-gitconfig
+++ b/home-dots/dot-gitconfig
@@ -23,6 +23,10 @@
 [diff]
   algorithm = histogram
 
+# https://docs.gitlab.com/ee/user/project/merge_requests/merge_request_troubleshooting.html#check-out-locally-by-adding-a-git-alias
+[alias]
+    mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
+
 [sendemail]
   smtpEncryption = tls
   smtpServer = mail.oscarnajera.com
-- 
cgit v1.2.3