Skip to content

Instantly share code, notes, and snippets.

@nils-werner
Created April 13, 2011 11:46
Show Gist options
  • Save nils-werner/917405 to your computer and use it in GitHub Desktop.
Save nils-werner/917405 to your computer and use it in GitHub Desktop.
Clone a repo, replace the origin remote and initialize all submodules
#!/bin/bash
cd $(pwd)
git clone $1 .
git submodule update --init
git remote rm origin
git remote add upstream $1
git remote add origin $2
#
# Put this file in any of the directories of your PATH (try echo $PATH to see them)
#
# Example:
# clone git://github.com/symphonycms/symphony-2.git git@github.com:nils-werner/symphony-2.git
#
# This will clone from the official Symphony-2-repo, initialize all submodules and add your own fork as the origin
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment