org.apache.maven.scm.provider.git.gitexe.command.checkout

## Class GitCheckOutCommand

- java.lang.Object
- - org.apache.maven.scm.command.AbstractCommand
  - - org.apache.maven.scm.command.checkout.AbstractCheckOutCommand
    - - org.apache.maven.scm.provider.git.gitexe.command.checkout.GitCheckOutCommand

All Implemented Interfaces:
  Command, GitCommand

    public class GitCheckOutCommand
    extends AbstractCheckOutCommand
    implements GitCommand

Version:
  $Id: GitCheckOutCommand.java 823147 2009-10-08 12:39:23Z struberg $
Author:
  Mark Struberg

### Field Summary

### Fields inherited from interface org.apache.maven.scm.command.Command

`ROLE`

### Constructor Summary

Constructors
Constructor and Description
`GitCheckOutCommand()`

### Method Summary

Methods
`static org.codehaus.plexus.util.cli.Commandline` `createCommandLine(GitScmProviderRepository repository, File workingDirectory, ScmVersion version)`
`protected CheckOutScmResult` `executeCheckOutCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version, boolean recursive)` For git, the given repository is a remote one.

### Methods inherited from class org.apache.maven.scm.command.checkout.AbstractCheckOutCommand

`executeCheckOutCommand, executeCommand`

### Methods inherited from class org.apache.maven.scm.command.AbstractCommand

`execute, getLogger, setLogger`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.maven.scm.command.Command

`execute, getLogger, setLogger`

### Constructor Detail

#### GitCheckOutCommand

    public GitCheckOutCommand()

### Method Detail

#### executeCheckOutCommand

    protected CheckOutScmResult executeCheckOutCommand(ScmProviderRepository repo,
                                           ScmFileSet fileSet,
                                           ScmVersion version,
                                           boolean recursive)
                                                throws ScmException

For git, the given repository is a remote one. We have to clone it first if the working directory does not contain a git repo yet, otherwise we have to git-pull it. TODO We currently assume a '.git' directory, so this does not work for --bare repos Execute Check out command line.

Specified by:
  `executeCheckOutCommand` in class `AbstractCheckOutCommand`
Parameters:
  `repo` - not null
  `fileSet` - not null
  `version` - not null
  `recursive` - `true` if recursive check out is wanted, `false` otherwise.
Returns:
  the checkout result
Throws:
  `ScmException` - if any

#### createCommandLine

    public static org.codehaus.plexus.util.cli.Commandline createCommandLine(GitScmProviderRepository repository,
                                                             File workingDirectory,
                                                             ScmVersion version)