-
-
Save phloreenm/dd57d3afd02c0ecdcb7cba1975523df3 to your computer and use it in GitHub Desktop.
Backup a Git branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: git-branch-backup.sh <remote> | |
# Originally from jlecour but I can't find his version anymore | |
if [ -z "$1" ] | |
then | |
remote='origin' | |
else | |
remote=$1 | |
fi | |
set -e | |
CUR=`git branch | grep '\*' | awk '{print $2}'` | |
git push --force ${remote} ${CUR}:backup/${USER}/${CUR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment