Skip to content

Instantly share code, notes, and snippets.

@dpwright
Created September 26, 2012 07:47
Show Gist options
  • Save dpwright/3786642 to your computer and use it in GitHub Desktop.
Save dpwright/3786642 to your computer and use it in GitHub Desktop.
Demonstrating git's use of HEAD as default branch
$git init repo1
Initialized empty Git repository in /home/daniel/liamtest/repo1/.git/
$cd repo1
$git ci --allow-empty -m "Commit on master"
[master (root-commit) cf699b0] Commit on master
$git co --orphan another-branch
Switched to a new branch 'another-branch'
$git ci --allow-empty -m "Commit on another-branch"
[another-branch (root-commit) 06f7586] Commit on another-branch
$cd ..
$git clone repo1/ repo2
Cloning into 'repo2'...
done.
$cd repo2
$git log
commit 06f7586381a9f96b3fbcbd49ed85c7a9c81a03da
Author: Daniel P. Wright <[email protected]>
Date: Wed Sep 26 16:40:36 2012 +0900
Commit on another-branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment