Understanding Git Merges

Viewed 63

I know this solution is somewhere, but I am having trouble understanding git.

I am a single developer and there are often no changes on other branches while I am using git.

Here is often what I do:

git branch changes
git checkout -b changes
/* changes occur */
git commit -m "Changes Occured"
/* Changes occur */
git commit -m "More Changes"

After this, i have the following visualization in my head:

  :
  | c2
  | |
  | c1
  | /
master

However, git gui shows this visualization

    :
    c2 changes
    |
    c1
    |
  master

I then merge my changes with master like so:

git checkout -b master
git merge changes

I have the following visualization:

:
| master, changes
|
| \
| c2
| |
| c1
| /

master

However, git gui shows:

:
| master, changes
c2
|
c1
|

master

Is this the expected behavior? Or am i doing something wrong?

3 Answers
Related