Skip to content

Instantly share code, notes, and snippets.

@HackerDaGreat57
Forked from seanbuscay/git_create_orphan.sh
Created October 9, 2022 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HackerDaGreat57/f42b4108007b511718f22c5c2834f4f5 to your computer and use it in GitHub Desktop.
Save HackerDaGreat57/f42b4108007b511718f22c5c2834f4f5 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