02 February 2020

blog ssh git

cd temp
git clone ../../workspace/canhelp5-2016/ partial
cd partial
git remote remove origin
git subtree split -P doc -b keepdoc
git checkout keepdoc
# Il manque de quoi supprimer l'historique des fichiers qu'on ne veut pas. 
git filter-branch -f --index-filter 'git rm -r --cached --ignore-unmatch Erreur500ServiceMIF' HEAD
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.{uml,patch,xml,txt,md}' HEAD
git filter-branch --prune-empty --tag-name-filter cat -- --all

Ensuite dans l'autre repo

git add partial ../partial
git fetch partial keepdoc
git checkout -b mergepartial
merge partial/keepdoc --allow-unrelated-histories

Une branche avec tous les mouvements

https://stackoverflow.com/questions/359424/detach-move-subdirectory-into-separate-git-repository
https://stackoverflow.com/questions/1365541/how-to-move-files-from-one-git-repo-to-another-not-a-clone-preserving-history