I'm trying to implement a git repository with just one branch (no other branches allowed). So I tried to do something like the following:
git rm -r -f *
git checkout <hash> .
*** make changes you want ***
git stage -A
git commit -m <commit message>
Which works totally fine for me when using it by the console. However when using jgit I'm struggeling to implement the "git checkout <hash> ." part, since it doesn't allow me to do something like this:
git.checkout().setName("$previousCommitId .").call()
The resulting message of it would be the following:
org.eclipse.jgit.api.errors.InvalidRefNameException: Branch name 1ff5273b10cdc61386ffe391560b7836da82a412 . is not allowed