Do you have branches in your git and want to merge them?

How to merge two branches?

Here is a simple example using RStudio.

  1. Initial commit. (“1st commit”)

  2. 2nd commit (“koi no yokan”)

  3. 3rd commit (“Tsuki ni nureta futari”)

  4. 4th commit (“Mayonaka Sugi no koi”)

  5. Making branch1

  6. Commit on branch1 (“Jirettai”)

  7. Move to master and 5th commit on 1st line (“Wine red”)

  8. Merge them. “git merge branch1”, conflict (not error messages on terminal and “U” in right top window on doc1.R) branch

  9. Mannually fix conflicts. edit edit

fixed conflicts

  1. Final commit. final commit

  2. Overview of commit history. final commit history

  3. More ditails? Visit git website.