Skip to content

Instantly share code, notes, and snippets.

@davidstrauss
Created June 16, 2016 16:24
Show Gist options
  • Save davidstrauss/4fcabc39fb150c88780a6ccc84f30307 to your computer and use it in GitHub Desktop.
Save davidstrauss/4fcabc39fb150c88780a6ccc84f30307 to your computer and use it in GitHub Desktop.
[straussd@athena merge-tag]$ git init
Initialized empty Git repository in /home/straussd/Sandbox/merge-tag/.git/
[straussd@athena merge-tag]$ echo "Hello world." > demo.txt
[straussd@athena merge-tag]$ git add demo.txt
[straussd@athena merge-tag]$ git commit -m"Init"
[master (root-commit) 2e4ed59] Init
1 file changed, 1 insertion(+)
create mode 100644 demo.txt
[straussd@athena merge-tag]$ git checkout -b new-branch
Switched to a new branch 'new-branch'
[straussd@athena merge-tag]$ echo "Hello again." > demo2.txt
[straussd@athena merge-tag]$ git checkout master
Switched to branch 'master'
[straussd@athena merge-tag]$ echo "Divergence." > demo3.txt
[straussd@athena merge-tag]$ git checkout new-branch
Switched to branch 'new-branch'
[straussd@athena merge-tag]$ git add demo2.txt
[straussd@athena merge-tag]$ git commit -m"Added file to branch."
[new-branch 742ca70] Added file to branch.
1 file changed, 1 insertion(+)
create mode 100644 demo2.txt
[straussd@athena merge-tag]$ git tag -a mytag -m"New tag."
[straussd@athena merge-tag]$ git checkout master
Switched to branch 'master'
[straussd@athena merge-tag]$ git add demo3.txt
[straussd@athena merge-tag]$ git commit -m"Added file to master"
[master 1b1ccd6] Added file to master
1 file changed, 1 insertion(+)
create mode 100644 demo3.txt
[straussd@athena merge-tag]$ git merge mytag
Merge made by the 'recursive' strategy.
demo2.txt | 1 +
1 file changed, 1 insertion(+)
create mode 100644 demo2.txt
[straussd@athena merge-tag]$ git log --graph
* commit 9dcf4368a2fbae20d5c9fb1ad7e96af3ee27db43
|\ Merge: 1b1ccd6 742ca70
| | Author: David Strauss <david@davidstrauss.net>
| | Date: Thu Jun 16 09:23:04 2016 -0700
| |
| | Merge tag 'mytag'
| |
| | New tag.
| |
| * commit 742ca70565bd06591534d21ae14cabc2ad0ac061
| | Author: David Strauss <david@davidstrauss.net>
| | Date: Thu Jun 16 09:22:33 2016 -0700
| |
| | Added file to branch.
| |
* | commit 1b1ccd6403a3d322339ec24223b42a26480b3ce2
|/ Author: David Strauss <david@davidstrauss.net>
| Date: Thu Jun 16 09:23:01 2016 -0700
|
| Added file to master
|
* commit 2e4ed5967174a6f0ef789109f38b027d19e4a274
Author: David Strauss <david@davidstrauss.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment