GitWrapper\GitWorkingCopy::add PHP Method

add() public method

Add file contents to the index.
public add ( string $filepattern, array $options = [] ) : GitWorkingCopy
$filepattern string Files to add content from. Fileglobs (e.g. *.c) can be given to add all matching files. Also a leading directory name (e.g. dir to add dir/file1 and dir/file2) can be given to add all files in the directory, recursively.
$options array An optional array of command line options.
return GitWorkingCopy
    public function add($filepattern, array $options = array())
    {
        $args = array('add', $filepattern, $options);
        return $this->run($args);
    }

Usage Example

Beispiel #1
0
 public function execute(GitWorkingCopy $git, LocalPackage $package)
 {
     $git->add('.');
     $this->dispatchEvent(StepsEvents::GIT_ADDED, new GitEventMade($git));
     $git->commit($this->getCommitMessage($git));
     $this->dispatchEvent(StepsEvents::GIT_COMMITTED, new GitEventMade($git));
     $git->push('origin', $package->getLocalBranch(), array('f' => true));
     $this->dispatchEvent(StepsEvents::GIT_PUSHED, new GitEventMade($git));
     return null === $git->getStatus() ? true : false;
 }
All Usage Examples Of GitWrapper\GitWorkingCopy::add