Skip to content

Instantly share code, notes, and snippets.

@aweary
Created February 27, 2017 16:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aweary/946981c638cbd209e3c2a27940b64302 to your computer and use it in GitHub Desktop.
Save aweary/946981c638cbd209e3c2a27940b64302 to your computer and use it in GitHub Desktop.
Add an upstream remote quickly for Github repos
#! /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