Comment fusionner deux dépôts Git

Mots clés : gitmergerepositorygit-subtreegit

meilleur 5 Réponses Comment fusionner deux dépôts Git

vote vote


cd path/to/project-b git remote add project-a /path/to/project-a git fetch project-a --tags git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge git remote remove project-a 
cd path/to/project-a git filter-repo --to-subdirectory-filter project-a 
vote vote


git remote add -f Bproject /path/to/B git merge -s ours --allow-unrelated-histories --no-commit Bproject/master git read-tree --prefix=dir-B/ -u Bproject/master git commit -m "Merge B project as our subdirectory" git pull -s subtree Bproject master 
vote vote


git subtree add --prefix=rails git:// master 
git log <rev> git blame <rev> -- 
# finishes with all files added at once commit git log rails/  # then continue from original tree git log <rev> -- 
vote vote


git remote add projb [wherever] git pull projb 
vote vote


git log projectA 
PREFIX=projectA #adjust this  git filter-branch --index-filter '     git ls-files -s |     sed "s,\t,&'"$PREFIX"'/," |     GIT_INDEX_FILE=$ git update-index --index-info &&     mv $ $GIT_INDEX_FILE ' HEAD 
git pull path/to/A 

Questions similaires