Skip to content

Instantly share code, notes, and snippets.

@aweary
Created February 27, 2017 16:30
Show Gist options
  • Select an option

  • Save aweary/946981c638cbd209e3c2a27940b64302 to your computer and use it in GitHub Desktop.

Select an option

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