From 2be33671b03dd7fe8f4db6829253887e20b26d4b Mon Sep 17 00:00:00 2001 From: Kael Date: Tue, 25 Nov 2025 00:19:06 +1100 Subject: [PATCH 1/2] feat: add "dev" as alternate branch name for gcod --- functions/__git.develop_branch.fish | 8 ++++++++ functions/__git.init.fish | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 functions/__git.develop_branch.fish diff --git a/functions/__git.develop_branch.fish b/functions/__git.develop_branch.fish new file mode 100644 index 0000000..d34de0a --- /dev/null +++ b/functions/__git.develop_branch.fish @@ -0,0 +1,8 @@ +function __git.develop_branch -d "Use dev if it exists. Falls back to develop" + command git rev-parse --git-dir &>/dev/null; or return + if command git show-ref -q --verify refs/heads/dev + echo dev + else + echo develop + end +end diff --git a/functions/__git.init.fish b/functions/__git.init.fish index 6c205f9..95a6b71 100644 --- a/functions/__git.init.fish +++ b/functions/__git.init.fish @@ -158,7 +158,7 @@ function __git.init # git checkout abbreviations __git.create_abbr gco git checkout __git.create_abbr gcb git checkout -b - __git.create_abbr gcod git checkout develop + __git.create_abbr gcod git checkout \(__git.develop_branch\) __git.create_abbr gcom git checkout \(__git.default_branch\) # git flow abbreviations From 7699b9c1f69c967ef169f6c6bc433cf5947f693a Mon Sep 17 00:00:00 2001 From: Kael Date: Tue, 25 Nov 2025 00:22:25 +1100 Subject: [PATCH 2/2] docs: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92b8100..7c11f78 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ gunwip # restore work in progress | Abbreviation | Command | | ------------ | ---------------------------------------------------- | | gco | `git checkout` | -| gcod | `git checkout develop` | +| gcod | `git checkout (__git.develop_branch)` | | gcom | `git checkout (__git.default_branch)` | | gcb | `git checkout -b` |