Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] How to accept mine if any conflicts occur while pull-rebase in JGit

I have the following piece of code that does pull with rebase. However it doesn't work if any conflicts occur while merging. If they do occur, I want to accept mine. Thanks.

 private void pullWithRebase(Git git) throws GitAPIException {
    List<Ref> branches = git.branchList().setListMode(ListBranchCommand.ListMode.ALL).call();
    String remoteMasterBranchName = "refs/remotes/origin/master";
    for (Ref ref : branches) {
        if (remoteMasterBranchName.equals(ref.getName())) {
            PullResult result = git.pull().setRemoteBranchName("master").setRebase(true).call();

Back to the top