Skip to content

Remote URL cannot be accessed for git < 2.7 if SSH isn't working #694

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

Closed
rgerkin opened this issue Nov 5, 2017 · 0 comments
Closed

Remote URL cannot be accessed for git < 2.7 if SSH isn't working #694

rgerkin opened this issue Nov 5, 2017 · 0 comments

Comments

@rgerkin
Copy link
Contributor

rgerkin commented Nov 5, 2017

If the system git is < 2.7, and the URL is one that git expects to use SSH access on, but SSH isn't working for any reason, then self.repo.git.remote("show", self.name) here in remote.py will fail with:

GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git remote show origin
  stderr: 'Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.'

or related errors if SSH is not installed or on the path.

This can be fixed by falling back to git config --get remote.%s.url' % self.name which just reads the URL directly from the configuration.

rgerkin added a commit to rgerkin/GitPython that referenced this issue Nov 5, 2017
@rgerkin rgerkin changed the title Remote URL cannot be accessed for git < 2.7 if URL is git@github but SSH keys are not setup Remote URL cannot be accessed for git < 2.7 if SSH isn't working Nov 5, 2017
Byron added a commit that referenced this issue Nov 19, 2017
yarikoptic added a commit to yarikoptic/GitPython that referenced this issue Nov 27, 2017
* upstream/master: (83 commits)
  Remove trailing slash on drive path
  Further update for machines without ssh installed or on the path
  Update remote.py to fix issue gitpython-developers#694
  IndexFile.commit() now runs pre-commit and post-commit and commit-msg hooks.
  Update base.py
  Update remote.py
  Update base.py
  Update remote.py
  Update signing key to latest version
  recognize the new packed-ref header format
  Only gc.collect() under windows
  Converting path in clone and clone_from to str before any other operation in case eg pathlib.Path is passed
  Fix encoding issue with stderr_value and kill_after_timeout
  Store submodule name
  updating AUTHORS
  Keeping env values passed to `clone_from`
  Fix test_docs
  Apparently bdist_wheel is only in python3
  version bump
  BF: Added missing NullHandler to logger in git.remote
  ...
@Byron Byron added this to the v2.1.8 - Bugfixes milestone Dec 11, 2017
riley-martine pushed a commit to riley-martine/GitPython that referenced this issue Dec 7, 2023
riley-martine pushed a commit to riley-martine/GitPython that referenced this issue Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants