From ac4224804b2b458ff9853fbd949c4a100ae72dec Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Wed, 10 Sep 2025 16:30:02 +0100 Subject: [PATCH] Add a README and the worktrees script. --- README.md | 17 +++++++++++++++++ worktrees | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 README.md create mode 100755 worktrees diff --git a/README.md b/README.md new file mode 100644 index 0000000..127f390 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +README +====== +System configurations are stored in a seperate branch for each host or purpose. + +List available branches: + * git branch -avv + +Check out specific branch: + * git checkout + + +WORKTREES +========= +Instead of checking out individual branches into the worktree, it is possible to checkout multiple branches into sub-directories to work on concurrently. + +The set up script 'worktrees' in the "master" branch will create the necessary structure and add the worktrees. +This script should only be run once per clone's "master" worktree. diff --git a/worktrees b/worktrees new file mode 100755 index 0000000..c5cfed4 --- /dev/null +++ b/worktrees @@ -0,0 +1,9 @@ +#!/bin/bash +# Set up the structure to use worktrees in this clone. + +BRANCHES=("core") + +for BRANCH in "${BRANCHES[@]"; do + mkdir -p "$BRANCH" + git worktree add "./$BRANCH" "origin/$BRANCH" +done