Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

merge two branches from different repositories

git remote add <RemoteName> <RemoteURL>
git fetch <RemoteName>       
# check to see whether remote is available with 
git remote -v
git checkout -b <NewBranchName> <RemoteName/master>
# move all the files into a subdirectory so there aren't any conflicts with names (git mv)
git commit -m "moved"
git checkout master
git merge <NewBranchName> --allow-unrelated-histories
# cleanup everything with: 
git remote rm <RemoteName>
git branch -d <NewBranchName>
# check to see whether everything is correct with: 
git remote -v
git branch -a -v
git status
git push
Source by # #
 
PREVIOUS NEXT
Tagged: #merge #branches #repositories
ADD COMMENT
Topic
Name
2+1 =