Package org.eclipse.jgit.api

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


            SetupUpstreamMode mode;
            if (upstreamConfig == UpstreamConfig.NONE)
              mode = SetupUpstreamMode.NOTRACK;
            else
              mode = SetupUpstreamMode.SET_UPSTREAM;
            git.branchCreate().setName(name).setStartPoint(
                ref.getName()).setUpstreamMode(mode).call();
          }
          else
            git.branchCreate().setName(name).setStartPoint(commit)
                .setUpstreamMode(SetupUpstreamMode.NOTRACK)
View Full Code Here


              mode = SetupUpstreamMode.SET_UPSTREAM;
            git.branchCreate().setName(name).setStartPoint(
                ref.getName()).setUpstreamMode(mode).call();
          }
          else
            git.branchCreate().setName(name).setStartPoint(commit)
                .setUpstreamMode(SetupUpstreamMode.NOTRACK)
                .call();
        } catch (Exception e) {
          throw new CoreException(Activator.error(e.getMessage(), e));
        }
View Full Code Here

                .findGitDir() // scan up the file system tree
                .build();

        Git git = new Git(repository);

        git.branchCreate()
                .setName("master")
                // ?!? .setUpstreamMode(SetupUpstreamMode.SET_UPSTREAM)
                .setStartPoint("origin/master")
                .setForce(true)
                .call();
View Full Code Here

        for (Ref ref : call) {
            System.out.println("Branch-Before: " + ref + " " + ref.getName() + " " + ref.getObjectId().getName());
        }

        // run the add-call
        git.branchCreate()
                .setName("testbranch")
                .call();

        call = new Git(repository).branchList().call();
        for (Ref ref : call) {
View Full Code Here

    file = new File(workdir, "file2.txt");
    FileUtils.createNewFile(file);
    git.add().addFilepattern("file2.txt").call();
    git.commit().setMessage("second commit").call();
    git.branchCreate().setName("dev").call();

    file = new File(workdir, "file3.txt");
    FileUtils.createNewFile(file);
    git.add().addFilepattern("file3.txt").call();
    git.commit().setMessage("third commit").call();
View Full Code Here

      // fetch
      final String ref = fetchBundle(git, bundle, refName);

      // branch
      git.branchCreate().setName(branchName).setForce(true).setStartPoint(ref).call();

      // checkout
      final String head = git.checkout().setName(branchName).call().getObjectId().getName();

      // clean workspace
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

               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

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.