Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |

Expand Down
8 changes: 8 additions & 0 deletions functions/__git.develop_branch.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function __git.develop_branch -d "Use develop if it exists. Falls back to dev"
command git rev-parse --git-dir &>/dev/null; or return
if command git show-ref -q --verify refs/heads/develop
echo develop
else
echo dev
end
end
2 changes: 1 addition & 1 deletion functions/__git.init.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down