Get the command to update the working tree of the local repository.
199904
def get_checkout_command(self, revision, clean=False):
        """"""
        command = ['hg', 'update']
        if clean:
            command.append('--clean')
        command.append('--rev=%s' % revision)
        return command
680040
def update(self) -> None:
        
        for source_old in self:
            if isinstance(source_old, RemoteSource):
                repo = git.Repo(source_old.location)
                origin = repo.remotes.origin
                origin.pull()

                sha = repo.head.object.hexsha
                version = repo.git.rev_parse(sha, short=8)

                if version != source_old.version:
                    source_new  = RemoteSource(source_old.name,
                                               source_old.location,
                                               source_old.url,
                                               version)
                    logger.info("updated source: %s [%s -> %s]", source_old.name,
                                                                 source_old.version,
                                                                 source_new.version)
                    self.load(source_new)

                else:
                    logger.debug("no updates for source: %s", source_old.name)

        # write to disk
        # TODO local directory may be corrupted if program terminates between
        #   repo being updated and registry being saved; could add a "fix"
        #   command to recalculate versions for remote sources
        self.save()
1151158
async function synchRepo(remote, pathname) {
  const cmd = `git subtree push --prefix=${pathname} ${remote} master`;

  try {
    await exec(cmd);
    logger.log(`Synched master of ${pathname}`);
  } catch (error) {
    throw error;
  }
}
1164481
function () {
				grunt.config('release.localBranch', 'release_' + new Date().getTime());
				var command = [
					'git fetch --tags ' + grunt.config('release.remoteRepository'),
					'git fetch ' + grunt.config('release.remoteRepository'),
					'git checkout -b ' + grunt.config('release.localBranch') + ' ' +
						grunt.config('release.remoteRepository') + '/' + grunt.config('release.remoteBaseBranch')
				].join(' && ');
				grunt.log.write('Checking out new local branch based on ' + grunt.config('release.remoteBaseBranch') + ': ' + command);
				return command;
			}
442712
def update_git_repository(self, folder, git_repository):
        

        # load repo object from path
        repo = git.Repo(folder)

        # keep local_head_name for to reset folder remote head later
        local_head_name = repo.head.ref.name

        # test if git repository url has changed
        remote = repo.remote('origin')
        if remote.url == git_repository:
            return

        # remove/add new remote repository origin
        remote.remove(repo, 'origin')
        origin = remote.add(repo, 'origin', git_repository)

        # fetch available branches
        origin.fetch()

        # get remote head according previously store local head name
        remote_head = getattr(origin.refs, local_head_name)
        # reset repository tracking branch according deduced remote head
        repo.create_head(local_head_name, remote_head)\
            .set_tracking_branch(remote_head)
735536
def get_pull_command(self, remote=None, revision=None):
        """"""
        command = ['hg', 'pull']
        if remote:
            command.append(remote)
        if revision:
            command.append('--rev=%s' % revision)
        return command
1003897
def build_up_commands
      local_versions.select{ |v| v > current_version && v <= target_version }
                    .map{ |v| ApplyCommand.new(v) }
    end
1290456
def build_tree_fast(self, new_path=None, seq_type='nucl' or 'prot'):
        """"""
        # Check output #
        if new_path is None: new_path = self.prefix_path + '.tree'
        # Command #
        command_args = []
        if seq_type == 'nucl': command_args += ['-nt']
        command_args += ['-gamma']
        command_args += ['-out', new_path]
        command_args += [self.path]
        # Run it #
        sh.FastTree(*command_args)
        # Return #
        return FilePath(new_path)
1209515
def update(self):
        
        def process_result(result):
            self.raw = result
        return Command('get', self.path, process_result=process_result)
1330085
function updateMaster () {
    pushCmds.push(
        comment('update package.json in master'),
        'git checkout master',
        `git pull --rebase ${origin} master --strategy=theirs`,
        `git checkout release/${newVersion} -- CHANGELOG.md`,
        `node -e "const newVersion = '${newVersion}'; ${stringifyFunction(buildCommand)}"`,
        'git add CHANGELOG.md',
        'git add package.json',
        `git commit -m "update version number in package.json to ${newVersion}"`,
        `git push ${origin} master`
    );

    function buildCommand () {
      require('fs').writeFileSync('package.json', JSON.stringify(getUpdatedJson(), null, 2));
      function getUpdatedJson () {
        const json = require('./package.json');
        json.version = newVersion;
        return json;
      }
    }

    function stringifyFunction (method) {
      return method
          .toString()
          .split('\n')
          .slice(1, -1)
          .map(function (line) { return line.trim(); })
          .join(' ')
          .replace(/"/g, '\\"');
    }
  }
1119307
def tarbell_update(command, args):
    
    with ensure_settings(command, args) as settings, ensure_project(command, args) as site:
        puts("Updating to latest blueprint\n")

        git = sh.git.bake(_cwd=site.base.base_dir)

        # stash then pull
        puts(colored.yellow("Stashing local changes"))
        puts(git.stash())

        puts(colored.yellow("Pull latest changes"))
        puts(git.pull())
        
        # need to pop any local changes back to get back on the original branch
        # this may behave oddly if you have old changes stashed
        if git.stash.list():
            puts(git.stash.pop())
741319
def fetch_local_package(self, config):
        
        # Update sys.path & merge in remote configs (if necessary)
        self.update_paths_and_config(config=config,
                                     pkg_dir_name=config['source'],
                                     pkg_cache_dir=os.getcwd())
33855
def update(self):
        """"""
        if not os.path.isdir(os.path.join(self.path)):
            os.makedirs(self.path)
        if not os.path.isdir(os.path.join(self.path, 'refs')):
            subprocess.check_output([
                'git', 'clone', '--bare', self.repo_git, self.path
            ])
        self.run(['gc', '--auto', '--prune=all'])
        self.run(['fetch', '-p', 'origin', '+refs/heads/*:refs/heads/*'])
        # github support
        self.run(['fetch', 'origin', '+refs/pull/*/head:refs/pull/*'])
        # gitlab support
        self.run([
            'fetch', 'origin', '+refs/merge-requests/*/head:refs/pull/*'])
1217239
def get_push_command(self, remote=None, revision=None):
        """"""
        # TODO What about tags?
        command = ['git', '-c', 'push.default=matching', 'push']
        if remote or revision:
            command.append(remote or 'origin')
            if revision:
                command.append(revision)
        return command
1051934
def _copy_update(sourcepath, destname):
    """"""
    if sys.platform.startswith('linux'):
        return os.system("/bin/cp -ua '%s' '%s'" % (sourcepath, destname))
    else:
        return os.system("rsync -ua '%s' '%s'" % (sourcepath, destname))
121566
def update(self, repo_dir, **kwargs):
        """"""
        del kwargs
        rev = self._args.get("revision")
        if rev:
            return [{"args": ["git", "checkout", rev], "cwd": repo_dir}] + _ff_command(
                rev, repo_dir
            )
        return None
812683
def get_tree_from_branch(self, ref):
        '''
        
        '''
        try:
            return self.peel(self.repo.lookup_reference(
                'refs/remotes/origin/{0}'.format(ref))).tree
        except KeyError:
            return None