Skip to content

Python script for splitting out large git repos into smaller ones whilst retaining git history

License

Notifications You must be signed in to change notification settings

Moncky/splitgit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

splitgit

Python script for splitting out large git repos into smaller ones whilst retaining git history.

It is pretty much entierly based on this blog post by Hendrik Will

The script clones from a local repo into a new directory, brings your chosen subdirectory to the top of the repo.

It will then perform some cleanup tasks before adding a new remote for your new repo.

The script will not push to the remote, that is currently left as task for the user, giving you a chance to review the new repo before proceeding. The script will leave your original repository untouched, you will need to tidy that up yourself at present.

Installation

You will need Python 2.7.x Though I have only tested against 2.7.11 You will need to install gitpython

pip --install gitpython

or you can setup a virtualenv and install gitpython there if you want.

#Usage

Lets say you have a big_repo that has directories foo and bar. To split out foo into its own git repo.

$ python splitgit.py -s ~/big_repo -d ~/new_repo -f foo -r origin -u [email protected]:Moncky/foo

see $ python splitgit.py --help for more info.

#Contributing

Please do. Fork the project, then commit and push till your happy.

About

Python script for splitting out large git repos into smaller ones whilst retaining git history

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages