Skip to content

Instantly share code, notes, and snippets.

@nicolae-olariu
Forked from seanbuscay/git_create_orphan.sh
Created January 9, 2019 07:33
Show Gist options
  • Save nicolae-olariu/b8c5b564e2559b8eb0a308ad29db7f02 to your computer and use it in GitHub Desktop.
Save nicolae-olariu/b8c5b564e2559b8eb0a308ad29db7f02 to your computer and use it in GitHub Desktop.
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment