Skip to content

Instantly share code, notes, and snippets.

@dcrosby42
Created February 5, 2010 16:03
Show Gist options
  • Save dcrosby42/295900 to your computer and use it in GitHub Desktop.
Save dcrosby42/295900 to your computer and use it in GitHub Desktop.
New git repo from branch
# Creating a new git repository based on the subdirectory of an existing repository
# Got this from: http://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository
git clone --no-hardlinks project327 compass
cd compass
git filter-branch --subdirectory-filter bloomfire-compass HEAD -- --all
git reset --hard
git gc --aggressive
git prune
(then push to wherever)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment