meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| git:merge [2016/06/16 13:18] – niziak | git:merge [2022/02/04 11:42] (current) – niziak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| + | |||
| + | ====== merge conflicts | ||
| - | Idea is to fetch remote repo RRR into local repo LLL | ||
| - | Then modify file location of repo BBB to be in desired path and merge it into repo LLL. | ||
| <code bash> | <code bash> | ||
| - | git remote add RRR http:// | + | git checkout --ours PATH/FILE |
| - | git fetch RRR | + | git checkout |
| - | git checkout -b branch_change_file_location RRR/master | + | |
| - | + | ||
| - | # now move files from remote repo RRR into correct path | + | |
| - | + | ||
| - | mkdir app_RRR | + | |
| - | git mv src app_RRR/ | + | |
| - | git commit | + | |
| - | + | ||
| - | # switch to LLL repo | + | |
| - | git checkout master | + | |
| - | # merge previously created branch "LLL/branch_change_file_location" | + | |
| - | git merge branch_change_file_location | + | |
| - | git commit | + | |
| - | + | ||
| - | # cleanup | + | |
| - | git remote rm RRR | + | |
| - | git branch -d branch_change_file_location | + | |
| - | + | ||
| - | # push merged master | + | |
| - | git push | + | |
| </ | </ | ||
| - | ====== Detach(move) subdirectory into separate Git repository ====== | ||
| - | [[http:// | ||
| - | <code bash> | ||
| - | # Split dir form repo | ||
| - | pushd < | ||
| - | git subtree split -P < | ||
| - | popd | ||
| - | # Create new repo | ||
| - | mkdir < | ||
| - | pushd < | ||
| - | |||
| - | git init | ||
| - | git pull </ | ||
| - | |||
| - | # Link the new repo to Github or wherever | ||
| - | |||
| - | git remote add origin < | ||
| - | git push origin -u master | ||
| - | |||
| - | #Cleanup, if desired | ||
| - | |||
| - | popd # get out of < | ||
| - | pushd < | ||
| - | |||
| - | git rm -rf < | ||
| - | |||
| - | </ | ||