Skip to content

How can I push to remote with flag "--no-follow-tags"? #1255

@church6

Description

@church6

I usually use comamnd "git push origin remote --no-follow-tags" to push my codes.
But when I use gitpython, I got error below:

Traceback (most recent call last):
  File "/home/android/bin/push.py", line 191, in <module>
    main()
  File "/home/android/bin/push.py", line 186, in main
    work()
  File "/home/android/bin/push.py", line 177, in work
    git_repo.git.push(url, remote)
  File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 588, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 1134, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/usr/local/lib/python3.6/dist-packages/git/cmd.py", line 931, in execute
    raise GitCommandError(redacted_command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git push ssh://android@gerrit.com:29418/kernel/msm-5.4 HEAD:refs/for/DEV_branch --no-follow-tags

my code is:

url = "ssh://android@gerrit.com:29418/kernel/msm-5.4"
remote = "HEAD:refs/for/DEV_branch --no-follow-tags"
git_repo.git.push(url, remote)

How to fix my issue?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions