Class Main

java.lang.Object
org.eclipse.jgit.pgm.Main
Direct Known Subclasses:
CLIGitCommand

public class Main extends Object
Command line entry point.
  • Constructor Details

    • Main

      public Main()

      Constructor for Main.

  • Method Details

    • main

      public static void main(String[] argv) throws Exception
      Execute the command line.
      Parameters:
      argv - arguments.
      Throws:
      Exception
    • run

      protected void run(String[] argv) throws Exception
      Parse the command line and execute the requested action. Subclasses should allocate themselves and then invoke this method:
      class ExtMain {
              public static void main(String[] argv) {
                      new ExtMain().run(argv);
              }
      }
      
      Parameters:
      argv - arguments.
      Throws:
      Exception
    • openGitDir

      protected Repository openGitDir(String aGitdir) throws IOException
      Evaluate the --git-dir option and open the repository.
      Parameters:
      aGitdir - the --git-dir option given on the command line. May be null if it was not supplied.
      Returns:
      the repository to operate on.
      Throws:
      IOException - the repository cannot be opened.