Skip to content

Instantly share code, notes, and snippets.

@EHER
Created February 5, 2012 04:27
Show Gist options
  • Save EHER/1742705 to your computer and use it in GitHub Desktop.
Save EHER/1742705 to your computer and use it in GitHub Desktop.
#!/bin/sh
PROJECTNAME="$1"
DESTPATH="$2"
GITURL="$3"
VERSION="$4"
git remote add -f $PROJECTNAME $GITURL
git merge -s ours --no-commit $PROJECTNAME/$VERSION
git read-tree --prefix=$DESTPATH -u $PROJECTNAME/$VERSION
git commit -m "Merge $PROJECTNAME project as our subdirectory"
git pull -s subtree $PROJECTNAME $VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment