Skip to content

Instantly share code, notes, and snippets.

@cmbuckley
Last active October 8, 2019 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmbuckley/bd495a3b891396cd4dc30a87e54d7084 to your computer and use it in GitHub Desktop.
Save cmbuckley/bd495a3b891396cd4dc30a87e54d7084 to your computer and use it in GitHub Desktop.

This is just an example for https://stackoverflow.com/q/58283005/283078.

The following commands were run to create this history:

git checkout -b dev
git commit --allow-empty -m 'Dev commit 1'
git commit --allow-empty -m 'Dev commit 2'
git commit --allow-empty -m 'Dev commit 3'
git checkout master
git merge --no-ff dev
git checkout dev
git rebase master
git commit --allow-empty -m 'Dev commit 4'
git commit --allow-empty -m 'Dev commit 5'
git checkout master
git merge --no-ff dev
git tag v1

The output for git log --graph --oneline v1 is as follows:

*   f73dd5d Merge branch 'dev'
|\
| * 7f79a4d Dev commit 5
| * ea3d262 Dev commit 4
|/
*   bdc04c9 Merge branch 'dev'
|\
| * e9d9f3a Dev commit 3
| * 4f54fd0 Dev commit 2
| * 7f601a0 Dev commit 1
|/
* 93a1d6e

The output using tig is as follows:

2019-10-08 12:37 M─┐ [master] <v1> Merge branch 'dev'
2019-10-08 12:37 │ o [dev] Dev commit 5
2019-10-08 12:37 │ o Dev commit 4
2019-10-08 12:33 M─┘ Merge branch 'dev'
2019-10-08 12:33 │ o Dev commit 3
2019-10-08 12:33 │ o Dev commit 2
2019-10-08 12:33 │ o Dev commit 1
2019-10-08 11:30 I─┘
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment