Git/TortoiseGit: Merge Between Base Project and Derived Project

Situation

Need to merge between 2 projects which are not to be the same. Some files are to be identical but some files are to be different.

Git Commands

git checkout base-dev
# Both --no-ff and --no-commit are required:
git merge dev --no-ff --no-commit
git reset
git checkout path/to/file/to/be/different
git add -A
git commit -a -m Msg
git push

TortoiseGit

Preparation

  • To see different files between 2 branches (1 of base project, 1 of derived project)
    • Open Windows Explorer
    • Context menu >> Browse References
    • Ctrl + click to choose 2 branches
    • Right click and choose Compare selected

Steps

  • Context menu >> Git Merge
  • On merge dialogue, tick both No Fast Forward, No Commit
  • See changed files by: Context menu >> Git Diff
  • Choose code blocks of each file in a list shown, TortoiseGit possibly does this part with both (reset+save, not checkout)
  • Add, commit, push as usual.

You'll only receive email when they publish something new.

More from 19411
All posts