Created
February 27, 2017 16:30
-
-
Save aweary/946981c638cbd209e3c2a27940b64302 to your computer and use it in GitHub Desktop.
Add an upstream remote quickly for Github repos
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
#! /usr/bin/env bash | |
# Quickly add an upstream remote repo from Github. | |
git_dir_path=`git rev-parse --show-toplevel` | |
repo_name=`basename ${git_dir_path}` | |
echo "Setting upstream to ${1}/${repo_name}" | |
git remote add upstream https://github.com/"$1"/"$repo_name".git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment