Skip to content

Instantly share code, notes, and snippets.

@giuliandrimba
Created June 29, 2012 18:02
Show Gist options
  • Save giuliandrimba/3019661 to your computer and use it in GitHub Desktop.
Save giuliandrimba/3019661 to your computer and use it in GitHub Desktop.
GIT: Create empty branch
git symbolic-ref HEAD refs/heads/empty
touch .gitignore
git add .gitignore
git commit -m 'Initial headless branch commit'
@jimmont
Copy link

jimmont commented Mar 26, 2015

or just git checkout --orphan empty ?

@yangshun
Copy link

Nice, it worked for me ^

@alanoe
Copy link

alanoe commented May 10, 2016

git checkout --orphan is not available in older git versions

@olets
Copy link

olets commented Jun 4, 2016

The --orphan option should work for most people (it was introduced by 1.7.2 in 2010). Documentation is here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment