Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Git.branchCreate()


                       .call();
                }
                else
                {
                    reporter.debugText(SHORT_NAME,"creating new local develop branch without origin");
                    git.branchCreate()
                       .setName(context.getDevelop())
                       .setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.NOTRACK)
                       .call();
                }
            }
View Full Code Here


               for (Ref branchRef : refs)
               {
                  String branchName = branchRef.getName();
                  if (branchName != null && branchName.endsWith(targetRef))
                  {
                     ref = repo.branchCreate().setName(targetRef).setUpstreamMode(SetupUpstreamMode.TRACK)
                              .setStartPoint("origin/" + targetRef).call();
                  }
               }
            }
View Full Code Here

                  {
                     ref = tags.get(version);

                     if (ref == null)
                     {
                        ref = repo.branchCreate().setName(version).setUpstreamMode(SetupUpstreamMode.TRACK)
                                 .setStartPoint("origin/" + version).call();
                     }
                  }
               }
            }
View Full Code Here

    public static Git createRepositoryWithMasterAndDevelop(File dir) throws GitAPIException
    {
        Git git =  Git.init().setDirectory(dir).call();
        git.add().addFilepattern(".").call();
        git.commit().setMessage("initial commit").call();
        git.branchCreate().setName("develop").call();
        git.commit().setMessage("added develop branch").call();

        return git;
    }
View Full Code Here

        Git git =  Git.init().setDirectory(dir).call();
        git.commit().setMessage("initial commit").call();

        for(String branch : branches)
        {
            git.branchCreate().setName(branch).call();
            git.commit().setMessage("added branch " + branch).call();
        }

        return git;
    }
View Full Code Here

               for (Ref branchRef : refs)
               {
                  String branchName = branchRef.getName();
                  if (branchName != null && branchName.endsWith(targetRef))
                  {
                     ref = repo.branchCreate().setName(targetRef).setUpstreamMode(SetupUpstreamMode.TRACK)
                              .setStartPoint("origin/" + targetRef).call();
                  }
               }
            }
View Full Code Here

                  {
                     ref = tags.get(version);

                     if (ref == null)
                     {
                        ref = repo.branchCreate().setName(version).setUpstreamMode(SetupUpstreamMode.TRACK)
                                 .setStartPoint("origin/" + version).call();
                     }
                  }
               }
            }
View Full Code Here

         {
            List<Ref> refs = GitUtils.getRemoteBranches(repo);
            for (Ref branchRef : refs) {
               if (branchRef.getName().endsWith(targetRef))
               {
                  ref = repo.branchCreate().setName(targetRef).setUpstreamMode(SetupUpstreamMode.TRACK)
                           .setStartPoint("origin/" + targetRef).call();
               }
            }
         }
View Full Code Here

            //if no local master exists, but a remote does, check it out
            if (!GitHelper.localBranchExists(git, context.getMaster()) && GitHelper.remoteBranchExists(git, context.getMaster(), reporter))
            {
                reporter.debugText(SHORT_NAME,"creating new local master branch from origin master");
                git.branchCreate()
                   .setName(context.getMaster())
                   .setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.SET_UPSTREAM)
                   .setStartPoint("origin/" + context.getMaster())
                   .call();
            }
View Full Code Here

            if (!GitHelper.localBranchExists(git, context.getDevelop()))
            {
                if (GitHelper.remoteBranchExists(git, context.getDevelop(), reporter))
                {
                    reporter.debugText(SHORT_NAME,"creating new local develop branch from origin develop");
                    git.branchCreate()
                       .setName(context.getDevelop())
                       .setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.SET_UPSTREAM)
                       .setStartPoint("origin/" + context.getDevelop())
                       .call();
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.