-
-
Save kristofk/d25ae85d5f021fae2c4e6685101417b2 to your computer and use it in GitHub Desktop.
Create an orphan branch in a repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Prepare branch | |
| cd repository | |
| git checkout --orphan <orphan-name> | |
| git rm -rf . | |
| rm '.gitignore' | |
| # Create a commit (this can be empty) and push | |
| git commit --allow-empty -m “root commit” | |
| git push origin orphan_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment