Created
June 7, 2014 16:38
-
-
Save lirazsiri/916a73d5953f9ef84cb3 to your computer and use it in GitHub Desktop.
A simple helper script for registering GitHub remotes. Change ACCOUNT has required.
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/bash | |
# Author: Liraz Siri <liraz@turnkeylinux.org>, licensed under the GPL | |
arg=$1 | |
progname=$(basename $(pwd|sed 's/\.git$//')) | |
set ${ACCOUNT:=turnkeylinux} | |
if [ -z "$PROJECT" ]; then | |
PROJECT=$progname | |
fi | |
if [ "$arg" == "-h" ]; then | |
cat<<EOF | |
Syntax: $0 | |
Environment variables: | |
ACCOUNT GitHub account name (default: $ACCOUNT) | |
PROJECT GitHub project name (default: $PROJECT) | |
What this does: | |
git remote add github git@github.com:$ACCOUNT/$PROJECT.git | |
git config remote.github.push +master:refs/heads/master | |
To remove: | |
git-remote | |
git-remote rm github | |
EOF | |
exit 1 | |
fi | |
set -x | |
git remote add github git@github.com:$ACCOUNT/$PROJECT.git | |
git config remote.github.push +master:refs/heads/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment