Skip to content

Instantly share code, notes, and snippets.

@schas002
Created February 16, 2017 07:53
Show Gist options
  • Save schas002/44130a41b7e3901628235744e78374cc to your computer and use it in GitHub Desktop.
Save schas002/44130a41b7e3901628235744e78374cc to your computer and use it in GitHub Desktop.
A mini-tutorial on feature branches.
user@localhost MINGW64 ~
$ git init mini-tut
Initialized empty Git repository in C:/Users/user/mini-tut/.git/
user@localhost MINGW64 ~
$ cd mini-tut
user@localhost MINGW64 ~/mini-tut (master)
$ git commit --allow-empty -m "Initial commit"
[master (root-commit) a023c25] Initial commit
user@localhost MINGW64 ~/mini-tut (master)
$ git config --global alias.tutorialcommit
commit --allow-empty -m 'Tutorial commit'
user@localhost MINGW64 ~/mini-tut (master)
$ git tutorialcommit
[master 8c00bff] Tutorial commit
user@localhost MINGW64 ~/mini-tut (master)
$ git tutorialcommit
[master bf2a5f8] Tutorial commit
user@localhost MINGW64 ~/mini-tut (master)
$ git tutorialcommit
[master b86710f] Tutorial commit
user@localhost MINGW64 ~/mini-tut (master)
$ git branch feature master
user@localhost MINGW64 ~/mini-tut (master)
$ git checkout feature
Switched to branch 'feature'
user@localhost MINGW64 ~/mini-tut (feature)
$ git tutorialcommit
[feature 6382497] Tutorial commit
user@localhost MINGW64 ~/mini-tut (feature)
$ git tutorialcommit
[feature d14f902] Tutorial commit
user@localhost MINGW64 ~/mini-tut (feature)
$ git tutorialcommit
[feature c0715ff] Tutorial commit
user@localhost MINGW64 ~/mini-tut (feature)
$ git checkout master
Switched to branch 'master'
user@localhost MINGW64 ~/mini-tut (master)
$ git merge feature
Updating b86710f..c0715ff
Fast-forward
user@localhost MINGW64 ~/mini-tut (master)
$ git log
commit c0715ff05a62f2fd9e656f2d77f8612e5acefe6b
Author: Andrew Zyabin <[email protected]>
Date: Thu Feb 16 11:52:41 2017 +0400
Tutorial commit
commit d14f902bbd04eb4e7c34c64a39c749905e937f6b
Author: Andrew Zyabin <[email protected]>
Date: Thu Feb 16 11:52:41 2017 +0400
Tutorial commit
commit 638249717dd4d0551252e98669be6b1e06ac111f
Author: Andrew Zyabin <[email protected]>
Date: Thu Feb 16 11:52:40 2017 +0400
Tutorial commit
commit b86710f1ae331df4bb38dd31cd4ddfd38bff2026
Author: Andrew Zyabin <[email protected]>
Date: Thu Feb 16 11:52:14 2017 +0400
Tutorial commit
commit bf2a5f88ed0ea932314b16995f9ba726dbdc7a5e
Author: Andrew Zyabin <[email protected]>
Date: Thu Feb 16 11:52:14 2017 +0400
Tutorial commit
commit 8c00bff8750681103d8c5007483ec94100705bd9
Author: Andrew Zyabin <[email protected]>
Date: Thu Feb 16 11:52:13 2017 +0400
Tutorial commit
commit a023c25001b86e346a2a855686e91bf952be6b78
Author: Andrew Zyabin <[email protected]>
Date: Thu Feb 16 11:51:41 2017 +0400
Initial commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment