Add custom git commands to dotfiles repo
Include git-branch-backup, git-fix-author, git-name-stash, git-name-stash-apply, git-rebase-on, and git-rename-branch in a new bin/ directory. Update install.sh to symlink them into ~/bin and document them in the README. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
9
bin/git-branch-backup
Executable file
9
bin/git-branch-backup
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/zsh -f
|
||||
|
||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [[ $CURRENT_BRANCH == HEAD ]] ; then
|
||||
CURRENT_BRANCH=$(git rev-parse --short HEAD) # in case detached HEAD
|
||||
fi
|
||||
NEW_BRANCH=${CURRENT_BRANCH}-backup-$(date +%Y%m%d-%H%M%S)
|
||||
git checkout -b $NEW_BRANCH
|
||||
git checkout -
|
||||
Reference in New Issue
Block a user