Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

difficult error when fetching remote refs #1982

Closed
mjgaughan opened this issue Dec 10, 2024 · 0 comments
Closed

difficult error when fetching remote refs #1982

mjgaughan opened this issue Dec 10, 2024 · 0 comments

Comments

@mjgaughan
Copy link

Hello!

I am running into an error when I try to fetch some refs from the remote of my repository. I have spent some time in the GitPython docs but am still unable to work my head around where I could be going wrong, thus I am opening the ticket.

I'm running into issues with the line below, where repo is a git.Repo instance.
repo.remote().fetch('refs/pull/*/merge:refs/pull/*/merge')
I have pasted the partial traceback below:

 File "collating_prs.py", line 12, in get_prs
    results = repo.remote().fetch('refs/pull/*/merge:refs/pull/*/merge')
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "lib/python3.11/site-packages/git/remote.py", line 1069, in fetch
    res = self._get_fetch_info_from_stderr(proc, progress, kill_after_timeout=kill_after_timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.11/site-packages/git/remote.py", line 895, in _get_fetch_info_from_stderr
    proc.wait(stderr=stderr_text)
  File "/lib/python3.11/site-packages/git/cmd.py", line 834, in wait
    raise GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git fetch -v -- origin refs/pull/*/merge:refs/pull/*/merge

In a bash terminal, the command git fetch -v -- origin refs/pull/*/merge:refs/pull/*/merge works and returns the refs that I am trying to fetch.

I'm not quire sure where to start looking at this and would appreciate any guidance. Thank you for your help!

@gitpython-developers gitpython-developers locked and limited conversation to collaborators Dec 10, 2024
@Byron Byron converted this issue into discussion #1983 Dec 10, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Development

No branches or pull requests

1 participant