Last active
December 25, 2015 23:39
-
-
Save ryansb/7058764 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Git subtree is included in git 1.7+, this part is only if you have below v1.7. | |
#git clone https://github.com/apenwarr/git-subtree.git && cd git-subtree | |
#sudo yum install xmlto asciidoc | |
#make doc | |
#sudo make install | |
cd ~/code/myrepo | |
git subtree split --prefix path/you/want --branch WhatIWant | |
git checkout master && git log --oneline | wc -l | |
git checkout WhatIWant && git log --oneline | wc -l # WhatIWant will only have the history of that path | |
rm -rf path/you/want | |
mkdir path/you/want | |
cd path/you/want | |
git pull ../ WhatIWant | |
git remote add origin [email protected]:me/WhatIWant | |
git push --set-upstream origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment