![]() ![]() Remote: Total 129 (delta 0), reused 0 (delta 0), pack-reused 129 JGit want's that you do the steps explicitly.īut maybe I am not fully understanding your setup. That new branch is configured to have the remote branch as upstream. And there seems to be a shortcut in native git that when you checkout a branch which doesn't exist locally but where a remote tracking branch with that name exists then a new local branch is created and checked out. But there is a remote tracking branch called "remotes/origin/featureBranch". There is no branch, no tag, called featureBranch. ![]() When you issue "git checkout featureBranch" then native git tries to find a ref called featureBranch but can't find it. The thing is that in native git "git checkout featureBranch" also does a branch creation under the hood. Native git seems to be able to do the checkout without branch creation while JGit is not. Why can you say "git checkout featureBranch" and JGit forces you to do something similar to "git checkout -b featureBranch. I would like to comment first on the checkout issue. When I look at my repo, It looks like there was a merge conflict that couldn't resolve-which doesn't make sense? I either just checked out the exact remote featureBranch-which wouldn't have a merge conflict-or I created a new local featureBranch then am trying to rebase remote changes onto it-which again, wouldn't create a conflict if using `git pull -rebase`Īny and all help is appreciated! I am drowning here. The pull fails, and the error from ret.getRebaseResult().getStatus() is simply "STOPPED", which is uninformative. Here is where I get into trouble:Īfter either a `git checkout featureBranch` or `git checkout -b featureBranch`, I am about to do `git pull -rebase`.Īfter checking out / creating / whatever JGit is doing, if I try to do a rebase in JGit here using: However, it seems that JGit wants me to `().setCreateBranch(true).setName("featureBranch").call()` - which is misleading to me but I suppose is fine. `git checkout featureBranch`, not `git checkout -b featureBranch`, the latter of which is the real "create new branch". Now, in this scenario, my normal git workflow would simply be: I have an upstream branch: refs/remotes/origin/featureBranch. I am on refs/heads/master, I do a Git.fetch().call() and Git.pull().call() just to make sure everything is updated and current. I open my git repo with Git.open(), everything looks good. My git intuition is failing me when using JGit for checkouts. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |