I'm using JGit to create an orphan branch as outlined on this answer.
What is the equivalent command rm .git/index; git clean -fdx
in JGit?
I'm able to create a new branch normally without the --orphan
argument, but am unsure how to apply it as well as the command to delete the branched files, which you would do normally as git rm -rf .
I know that I can checkout an orphan branch, will it achieve the same thing? git.checkout().setOrphan()
. Is it as simple as git.getRepository().getWorkTree().delete()
?