Push new version and corresponding tag to origin
    :return:
544826
def git_push():
    

    # get current version
    new_version = version.__version__
    values = list(map(lambda x: int(x), new_version.split('.')))

    # Push to origin new version and corresponding tag:
    # * commit new version
    # * create tag
    # * push version,tag to origin
    local('git add pynb/version.py version.py')

    local('git commit -m "updated version"')
    local('git tag {}.{}.{}'.format(values[0], values[1], values[2]))
    local('git push origin --tags')
    local('git push')
632448
def _get_last_tag(self):
        

        current_version = LooseVersion(
            self._get_version_from_tag(self.release_notes_generator.current_tag)
        )

        versions = []
        for tag in self.repo.tags():
            if not tag.name.startswith(self.github_info["prefix_prod"]):
                continue
            version = LooseVersion(self._get_version_from_tag(tag.name))
            if version >= current_version:
                continue
            versions.append(version)
        if versions:
            versions.sort()
            return "{}{}".format(self.github_info["prefix_prod"], versions[-1])
794516
def bump_version(project, source, force_init):  # type: (str, str, bool, bool) ->int
    
    file_opener = FileOpener()
    # logger.debug("Starting version jiggler...")
    jiggler = JiggleVersion(project, source, file_opener, force_init)

    logger.debug(
        "Current, next : {0} -> {1} : {2}".format(
            jiggler.current_version, jiggler.version, jiggler.schema
        )
    )
    if not jiggler.version_finder.validate_current_versions():

        logger.debug(unicode(jiggler.version_finder.all_current_versions()))
        logger.error("Versions not in sync, won't continue")
        die(-1, "Versions not in sync, won't continue")
    changed = jiggler.jiggle_all()
    logger.debug("Changed {0} files".format(changed))
    return changed
8827
def deploy(version):
    
    NAME = "pathquery"
    git = Command("git").in_dir(DIR.project)
    version_file = DIR.project.joinpath("VERSION")
    old_version = version_file.bytes().decode('utf8')
    if version_file.bytes().decode("utf8") != version:
        DIR.project.joinpath("VERSION").write_text(version)
        git("add", "VERSION").run()
        git("commit", "-m", "RELEASE: Version {0} -> {1}".format(
            old_version,
            version
        )).run()
        git("push").run()
        git("tag", "-a", version, "-m", "Version {0}".format(version)).run()
        git("push", "origin", version).run()
    else:
        git("push").run()

    # Set __version__ variable in __init__.py, build sdist and put it back
    initpy = DIR.project.joinpath(NAME, "__init__.py")
    original_initpy_contents = initpy.bytes().decode('utf8')
    initpy.write_text(
        original_initpy_contents.replace("DEVELOPMENT_VERSION", version)
    )
    python("setup.py", "sdist").in_dir(DIR.project).run()
    initpy.write_text(original_initpy_contents)

    # Upload to pypi
    python(
        "-m", "twine", "upload", "dist/{0}-{1}.tar.gz".format(NAME, version)
    ).in_dir(DIR.project).run()
498757
def tag_and_push(context):
    """"""
    tag_option = '--annotate'
    if probe.has_signing_key(context):
        tag_option = '--sign'

    shell.dry_run(
        TAG_TEMPLATE % (tag_option, context.new_version, context.new_version),
        context.dry_run,
    )

    shell.dry_run('git push --tags', context.dry_run)
324134
def push(self):
        
        self.github_repo.create_and_push()
        self._repo = self.github_repo.repo
        return self._repo
1138494
def __git_tag_push():
        
        command = ['git', 'push', 'origin', '--tags']
        Shell.msg('Pushing tags...')

        if APISettings.DEBUG:
            Git.__debug(command, True)

        if not call(command):
            return True
        return False
32831
def update_version(self, version: Union[http.HttpVersion, str]) -> None:
        
        if isinstance(version, str):
            v = [l.strip() for l in version.split('.', 1)]
            try:
                version = http.HttpVersion(int(v[0]), int(v[1]))
            except ValueError:
                raise ValueError(
                    'Can not parse http version number: {}'
                    .format(version)) from None
        self.version = version
1156511
def update(
        ctx,
        archive_name,
        bumpversion='patch',
        prerelease=None,
        dependency=None,
        message=None,
        string=False,
        file=None):
    '''
    
    '''

    _generate_api(ctx)

    args, kwargs = _parse_args_and_kwargs(ctx.args)
    assert len(args) == 0, 'Unrecognized arguments: "{}"'.format(args)

    dependencies_dict = _parse_dependencies(dependency)

    var = ctx.obj.api.get_archive(archive_name)
    latest_version = var.get_latest_version()

    if string:

        with var.open(
                'w+',
                bumpversion=bumpversion,
                prerelease=prerelease,
                dependencies=dependencies_dict,
                metadata=kwargs,
                message=message) as f:

            if file is None:
                for line in sys.stdin:
                    f.write(u(line))
            else:
                f.write(u(file))

    else:
        if file is None:
            file = click.prompt('enter filepath')

        var.update(
            file,
            bumpversion=bumpversion,
            prerelease=prerelease,
            dependencies=dependencies_dict,
            metadata=kwargs,
            message=message)

    new_version = var.get_latest_version()

    if latest_version is None and new_version is not None:
        bumpmsg = ' new version {} created.'.format(
            new_version)

    elif new_version != latest_version:
        bumpmsg = ' version bumped {} --> {}.'.format(
            latest_version, new_version)

    elif var.versioned:
        bumpmsg = ' version remains {}.'.format(latest_version)
    else:
        bumpmsg = ''

    click.echo('uploaded data to {}.{}'.format(var, bumpmsg))
1102868
def push_state(self, new_file=''):
        ''

        self.subpackages.append({'detected_type': self.detected_type,
                                 'message_tree': self.message_tree,
                                 'resources': self.pushable_resources,
                                 'metadata': self.metadata})

        self.message_tree = {}
        self.pushable_resources = {}
        self.metadata = {'requires_chrome': False,
                         'listed': self.metadata.get('listed'),
                         'validator_version': validator.__version__}

        self.package_stack.append(new_file)
1010573
def push(self, image_id, service_name, tag=None, namespace=None, url=None, username=None, password=None,
             repository_prefix=None, **kwargs):
        
        auth_config = {
            'username': username,
            'password': password
        }

        build_stamp = self.get_build_stamp_for_image(image_id)
        tag = tag or build_stamp

        if repository_prefix:
            image_name = "{}-{}".format(repository_prefix, service_name)
        elif repository_prefix is None:
            image_name = "{}-{}".format(self.project_name, service_name)
        elif repository_prefix == '':
            image_name = service_name
        repository = "{}/{}".format(namespace, image_name)

        if url != self.default_registry_url:
            url = REMOVE_HTTP.sub('', url)
            repository = "%s/%s" % (url.rstrip('/'), repository)

        logger.info('Tagging %s' % repository)
        self.client.api.tag(image_id, repository, tag=tag)

        logger.info('Pushing %s:%s...' % (repository, tag))
        stream = self.client.api.push(repository, tag=tag, stream=True, auth_config=auth_config)

        last_status = None
        for data in stream:
            data = data.splitlines()
            for line in data:
                line = json.loads(line)
                if type(line) is dict and 'error' in line:
                    plainLogger.error(line['error'])
                    raise exceptions.AnsibleContainerException(
                        "Failed to push image. {}".format(line['error'])
                    )
                elif type(line) is dict and 'status' in line:
                    if line['status'] != last_status:
                        plainLogger.info(line['status'])
                    last_status = line['status']
                else:
                    plainLogger.debug(line)
816605
def push(self, set_upstream: bool = True):
        
        LOGGER.info('pushing repo to origin')

        try:
            self.repo.git.push()
        except GitCommandError as error:
            if 'has no upstream branch' in error.stderr and set_upstream:
                self.repo.git.push(f'--set-upstream origin {self.get_current_branch()}')
            else:
                raise
        self.push_tags()
1091437
function updateVersion2gitTag(pkg) {
	let tag = child_process.execSync('git describe --tag').toString().trim();
	pkg.version = tag;
}
43414
def tagversion(repo, level='patch', special=''):
    
    prepend = 'v'
    with lcd(repo):
        oldversion = local(
            'git describe --abbrev=0 --tags', capture=True).strip()
        if oldversion.startswith('v'):
            oldversion = oldversion[1:]
        else:
            prepend = ''
    major, minor, patch = [int(x) for x in re.split('\D', oldversion, 3)[:3]]
    if special:
        if not re.match('^[a-z]', special):
            raise ValueError('Special must start with a-z')
        if not re.match('[_a-zA-Z0-9]+', special):
            raise ValueError('Must contain start with lowercase letter')
    if level == 'major':
        major, minor, patch = major + 1, 0, 0
    elif level == 'minor':
        major, minor, patch = major, minor + 1, 0
    elif level == 'patch':
        major, minor, patch = major, minor, patch + 1
    version_string = '{}.{}.{}'.format(major, minor, patch) + special
    with lcd(repo):
        local('git tag -s --force {}{}'.format(prepend, version_string))
    return version_string
866287
def add_version(self, project, version, egg):
        
        url = self._build_url(constants.ADD_VERSION_ENDPOINT)
        data = {
            'project': project,
            'version': version
        }
        files = {
            'egg': egg
        }
        json = self.client.post(url, data=data, files=files,
                                timeout=self.timeout)
        return json['spiders']
587003
def commit_new_version(version: str):
    

    check_repo()
    commit_message = config.get('semantic_release', 'commit_message')
    message = '{0}\n\n{1}'.format(version, commit_message)
    repo.git.add(config.get('semantic_release', 'version_variable').split(':')[0])
    return repo.git.commit(m=message, author="semantic-release <semantic-release>")
1230162
def format_version(version, build_number=None, build_tag=BUILD_TAG):
    
    formatted_version = ".".join(map(str, version))

    if build_number is not None:
        return "{formatted_version}-{build_tag}-{build_number}".format(**locals())
    
    return formatted_version