Skip to content

Instantly share code, notes, and snippets.

@leblancd
Created June 21, 2017 19:52
Show Gist options
  • Save leblancd/d7daa5d665da28990c974daaf8f384b4 to your computer and use it in GitHub Desktop.
Save leblancd/d7daa5d665da28990c974daaf8f384b4 to your computer and use it in GitHub Desktop.
Script to clone a containernetworking/plugins fork
#!/bin/bash
working_dir=$GOPATH/src/github.com/containernetworking
user=leblancd
repo=plugins
upstream_repo=containernetworking/plugins
mkdir -p $working_dir
cd $working_dir
git clone https://github.com/$user/$repo.git
# Add upstream repo
cd $working_dir/$repo
git remote add upstream https://github.com/$upstream_repo.git
# Never push to upstream master
git remote set-url --push upstream no_push
# Confirm that remote makes sense
git remote -v
cd $working_dir/$repo
go get ./...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment