问题
I created two branches with start point to origin/master does it have any meaning when i checkout the branches ( move between the branches ) with parameter of start Point ? What happened if I move or not moved the parameter startPoint when I checkout branches?
回答1:
You can see setStartPoint used for createBranch (also in this example)
Ref ref = git.branchCreate().setName("testbranch").setStartPoint("origin/testbranch").call();
You can also set a startpoint on a checkout command, when you want to checkout not the HEAD of a branch, but a previous commit.
Example:
CheckoutCommand co = git.checkout();
File test = writeTrashFile(FILE1, "");
File test2 = writeTrashFile(FILE2, "");
co.setStartPoint("HEAD~2").addPath(FILE1).addPath(FILE2).call();
What happened if I move or not moved the parameter startPoint when I checkout branches
You would checkout HEAD (no startPoint specified) or you would checkout another commit from the branch checked out.
来源:https://stackoverflow.com/questions/37130665/what-is-the-meaning-of-setstartpoint-in-jgit-when-you-move-branch