Create an orphan branch in a repo.
This file contains 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
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 |
@SeanHorner see gist:7df6c8a5…
(I note that checkout
is a git verb, so in this context it's not so unreasonable to conjugate it as checkouts and checkouted - just as long as nobody says those out loud.)
@SeanHorner see gist:7df6c8a5…
(I note that
checkout
is a git verb, so in this context it's not so unreasonable to conjugate it as checkouts and checkouted - just as long as nobody says those out loud.)
Ah, didn't think about it in that context, was using my linguist brain, not coding brain xD. Very interesting (and thorough) discussion in the linked gist 👍
Note that using
git switch --orphan <branch name>
automatically removes ALL files from the working tree.
Note that whatever is ignored by .gitignore won't be removed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you're looking for "checkedout", not "checkout'ed" 👍