Skip to content

Instantly share code, notes, and snippets.

@anonymoustafa
Forked from seanbuscay/git_create_orphan.sh
Created September 4, 2020 16:33
Show Gist options
  • Save anonymoustafa/70f51a5e6e36d1a8554de55e1bd75876 to your computer and use it in GitHub Desktop.
Save anonymoustafa/70f51a5e6e36d1a8554de55e1bd75876 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
@anonymoustafa
Copy link
Author

This is actually very nice. 😉️👨🏻‍💻️

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