Skip to content

Instantly share code, notes, and snippets.

@silvae86
Last active March 8, 2018 16:19
Show Gist options
  • Save silvae86/6f711588b893893ef3db80cc82939d93 to your computer and use it in GitHub Desktop.
Save silvae86/6f711588b893893ef3db80cc82939d93 to your computer and use it in GitHub Desktop.
Creating a new repository tracking another
#!/bin/bash
#credit https://stackoverflow.com/questions/24815952/git-pull-from-another-repository
#initialize repository
mkdir dendro-install-uporto
cd dendro-install-uporto
git init
git remote add origin https://github.com/feup-infolab/dendro-install-uporto.git
echo "# dendro-install-uporto" >> README.md
git add .
git commit -m "Initial commit"
git push -u origin master
# track upstream remote repository
git remote add upstream https://github.com/feup-infolab/dendro-install.git
#block pushing to the tracked repository
git config remote.upstream.pushurl "NEVER GONNA GIVE YOU UP"
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment