From b2a32d8202ae3359a7d3b3fd283734b7d76bd5d1 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Mon, 10 Jan 2022 17:44:45 +0100 Subject: [PATCH] Add git alias to clone as bare repo - This puts all of the git bare files into .bare and adds a .git file which specifies it's location. This makes for a nice and clean way to handle working with bare repositories - Bare repositories are very useful since they allow for neat workflow by using git worktrees that can basically create folders for individual branches. This means we can easily check out given brach just by entering that folder and we don't need to worry about conflicting files which we'd have to stash and then apply the stash once we're done done. --- home/.config/git/config | 1 + 1 file changed, 1 insertion(+) diff --git a/home/.config/git/config b/home/.config/git/config index 80ba740..3538bd3 100644 --- a/home/.config/git/config +++ b/home/.config/git/config @@ -4,6 +4,7 @@ signingkey = FB8CA11A2CF3A843 [alias] quickclone = "clone --single-branch --depth=1" + bareclone = "!sh -c 'git clone --bare \"$0\" \"$1\"/.bare; echo \"gitdir: ./.bare\" > \"$1/.git\"'" m = "merge" p = "push"