Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Create orphan branch


  I've tried to use CheckoutCommand to create an orphan branch, and found that it still has a parent. As I see from the Javadocs and sources, the startCommit has to be defined (or current HEAD is used).  This is really different from `git checkout --orphan` which creates branches detached from current history. I tried to set empty start point (.setStartPoint(walk.parseCommit(ObjectId.zeroId()))) but It fails, because zero commit is not resolved.

Could anybody please clarify if it is possible to achieve the same behavior with git checkout --detach using JGit API?


Back to the top