Skip to content

Commit

Permalink
Add checkout helper script
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Aug 25, 2023
1 parent 827f045 commit 6b4606a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions home/bin/git-co
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -euo pipefail

if [[ $# -eq 0 ]]; then
BRANCH=$(git branch --format "%(refname:short)" | fzf --exit-0)
git checkout $BRANCH
else
git checkout $*
fi
1 change: 0 additions & 1 deletion home/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
# Other aliases
ff = "!f() { git merge --ff-only origin/$(git branch-name); }; f";
st = "status";
co = "checkout";
su = "submodule update --init --recursive";
pr = "pull --rebase --prune";
mergeff = "merge --ff-only";
Expand Down

0 comments on commit 6b4606a

Please sign in to comment.