Merges branches.
`git merge <options> <name>`

@param $branch string
@param $options array|NULL

@throws ShellException
@return static
14704
public function merge($branch, $options = null) {
		return $this
			->begin()
			->run('git merge', $options, $branch)
			->end();
	}
691846
public static function mergeOptions($options1, $options2, $recursive = true)
    {
        if (!$recursive) {
            return array_merge($options1, $options2);
        }

        return Arr::mergeRecursive($options1, $options2);
    }
1138557
public function merge($options)
    {
        $other_options = self::parse($options);
        if ($other_options->apiKey === null) {
            $other_options->apiKey = $this->apiKey;
        }
        $other_options->headers = array_merge($this->headers, $other_options->headers);
        return $other_options;
    }
787628
public function cloneRepo($url, $branch = NULL, $dir = NULL)
	{
		$command = "clone";
		$command .= " --depth 1 --recursive $url";
		$command .= ($branch ? " --branch $branch" : '');
		$command .= ($dir ? ' ' . escapeshellarg($dir) : '');
		$this->setCommand($command);
	}
684726
private static function mergeOptions($options)
    {
        $result = (object) array(
            'base' => null,
            'expandContext' => null,
            'compactArrays' => true,
            'optimize' => false,
            'graph' => null,
            'useNativeTypes' => false,
            'useRdfType' => false,
            'produceGeneralizedRdf' => false,
            'documentFactory' => null,
            'documentLoader' => new FileGetContentsLoader()
        );

        if (is_array($options) || is_object($options)) {
            $options = (object) $options;
            if (isset($options->{'base'})) {
                if (is_string($options->{'base'})) {
                    $result->base = new IRI($options->{'base'});
                } elseif (($options->{'base'} instanceof IRI) && $options->{'base'}->isAbsolute()) {
                    $result->base = clone $options->{'base'};
                } else {
                    throw new \InvalidArgumentException('The "base" option must be set to null or an absolute IRI.');
                }
            }
            if (property_exists($options, 'compactArrays') && is_bool($options->compactArrays)) {
                $result->compactArrays = $options->compactArrays;
            }
            if (property_exists($options, 'optimize') && is_bool($options->optimize)) {
                $result->optimize = $options->optimize;
            }
            if (property_exists($options, 'graph') && is_string($options->graph)) {
                $result->graph = $options->graph;
            }
            if (property_exists($options, 'useNativeTypes') && is_bool($options->useNativeTypes)) {
                $result->useNativeTypes = $options->useNativeTypes;
            }
            if (property_exists($options, 'useRdfType') && is_bool($options->useRdfType)) {
                $result->useRdfType = $options->useRdfType;
            }
            if (property_exists($options, 'produceGeneralizedRdf') && is_bool($options->produceGeneralizedRdf)) {
                $result->produceGeneralizedRdf = $options->produceGeneralizedRdf;
            }
            if (property_exists($options, 'documentFactory') &&
                ($options->documentFactory instanceof DocumentFactoryInterface)) {
                $result->documentFactory = $options->documentFactory;
            }
            if (property_exists($options, 'documentLoader') &&
                ($options->documentLoader instanceof DocumentLoaderInterface)) {
                $result->documentLoader = $options->documentLoader;
            } elseif (null !== self::$documentLoader) {
                $result->documentLoader = self::$documentLoader;
            }
            if (property_exists($options, 'expandContext')) {
                if (is_string($options->expandContext)) {
                    $result->expandContext = $result->documentLoader->loadDocument($options->expandContext)->document;
                } elseif (is_object($options->expandContext)) {
                    $result->expandContext = $options->expandContext;
                }
                if (is_object($result->expandContext) && property_exists($result->expandContext, '@context')) {
                    $result->expandContext = $result->expandContext->{'@context'};
                }
            }
        }

        return $result;
    }
1073244
protected function mergeConfig($options)
    {
        $options = array_merge(
            $this->config->get('hipsupport::config'),
            $options
        );

        if (isset($options['notification'])
            and is_array($options['notification'])
        ) {
            $options['notification'] = array_merge(
                (array) $this->config->get('hipsupport::config.notification'),
                $options['notification']
            );
        }

        return $options;
    }
199348
protected function merge()
    {
        if (null === $this->merge) {
            $this->merge = new MergeBuilder($this);
        }

        return $this->merge;
    }
726484
protected function deployToBranch($options) {
    $this->branchName = $this->getBranchName($options);
    $this->prepareDir();
    $this->addGitRemotes();
    $this->checkoutLocalDeployBranch();
    $this->mergeUpstreamChanges();
    $this->build();
    $this->commit();
    $this->push($this->branchName, $options);
  }
811766
protected function _mergeOptions($options) {
		if (!is_array($options)) {
			$type = $options;
			if (!$type) {
				$type = 'info';
			}
			$options = [
				'type' => $type
			];
		}

		$options += ['type' => 'info'];
		$options += ['element' => $options['type']];

		$options += $this->getConfig();

		list($plugin, $element) = pluginSplit($options['element']);

		if ($plugin) {
			$options['element'] = $plugin . '.Flash/' . $element;
		} else {
			$options['element'] = 'Flash/' . $element;
		}

		return $options;
	}
545430
public function push($remote = 'origin', $branch = 'master', string $args = null)
    {
        if ($remote instanceof Remote) {
            $remote = $remote->getName();
        }
        if ($branch instanceof Branch) {
            $branch = $branch->getName();
        }
        $this->clearAll();
        $this->addCommandName(self::GIT_PUSH_COMMAND);
        $this->addCommandSubject($remote);
        $this->addCommandSubject2($branch);

        if(!is_null($args)) {
            $this->addCommandArgument($args);
        }

        return $this->getCommand();
    }
566480
protected function _mergeOptions(array $current, array $options)
    {
        if (isset($options['frontend']['name'])) {
            $current['frontend']['name'] = $options['frontend']['name'];
        }
        if (isset($options['backend']['name'])) {
            $current['backend']['name'] = $options['backend']['name'];
        }
        if (isset($options['frontend']['options'])) {
            foreach ($options['frontend']['options'] as $key=>$value) {
                $current['frontend']['options'][$key] = $value;
            }
        }
        if (isset($options['backend']['options'])) {
            foreach ($options['backend']['options'] as $key=>$value) {
                $current['backend']['options'][$key] = $value;
            }
        }
        return $current;
    }
12662
public function fetch($remote = null, $branch = null, Array $options = array())
    {
        if ($remote instanceof Remote) {
            $remote = $remote->getName();
        }
        if ($branch instanceof Branch) {
            $branch = $branch->getName();
        }
        $normalizedOptions = $this->normalizeOptions($options, $this->fetchCmdSwitchOptions());

        $this->clearAll();
        $this->addCommandName(self::GIT_FETCH_COMMAND);

        foreach ($normalizedOptions as $value) {
            $this->addCommandArgument($value);
        }

        if (!is_null($remote)) {
            $this->addCommandSubject($remote);
        }
        if (!is_null($branch)) {
            $this->addCommandSubject2($branch);
        }

        return $this->getCommand();
    }
97296
public function addOptions($options)
    {
        if (is_string($options)) {
            $this->mergeOptions($this->optionParser->parseString($options));
        } elseif (is_array($options)) {
            $this->mergeOptions($this->optionParser->parseArray($options));
        } else {
            throw new \InvalidArgumentException("Getopt(): argument must be string or array");
        }
    }
770251
public function reset($arg = null, array $options = array())
    {
        $this->clearAll();
        $this->addCommandName(self::GIT_RESET_COMMAND);
        // if there are options add them.
        if (! is_null($options)) {
            foreach ($options as $option) {
                $this->addCommandArgument($option);
            }
        }
        if($arg!=null){
            $this->addCommandSubject2($arg);
        }

        return $this->getCommand();
    }
356129
public function mergeWith(Translation $translation, $options = Merge::DEFAULTS)
    {
        Merge::mergeTranslation($translation, $this, $options);
        Merge::mergeReferences($translation, $this, $options);
        Merge::mergeComments($translation, $this, $options);
        Merge::mergeExtractedComments($translation, $this, $options);
        Merge::mergeFlags($translation, $this, $options);

        return $this;
    }
939767
public function pull($remote = 'origin', $branch = 'master')
    {
        if (!$this->hasCheckout) {
            throw new \RuntimeException('This operation requires an active checkout.');
        }

        return $this->execute('pull', array($remote, $branch));
    }
276017
public function addBranch($name, array $commands, $path = null, array $options = array())
    {
        $path = $path ? $path : $this->path;

        if (!array_key_exists($name, $this->branchesList)) {
            $this->logger->info('Add branch '.$name.', path: '.$path);

            $branch = new Branch($this, $name, $path, $options, $this->options);
            $branch->addCommand($commands);
            $this->branchesList[$name] = $branch;
        }

        return $this;
    }