Skip to content

Cannot push branch upstream #1408

@montmejat

Description

@montmejat

Hello,

I have a strange issue that I have not been able to resolve... It seems to maybe come from my SSH key, but I don't have any issues with it (git in the terminal works fine).

Here's what my code looks like:

git_repo = GitRepo.init(dataset_dir)
git_repo.create_remote("origin", url=git_remote_url)

git_repo.index.add(some_files)

git_repo.index.commit("Initial commit")
git_repo.git.push("--set-upstream", "origin", "master")

But at the last line, it breaks with this error:

git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git push --set-upstream origin master
  stderr: 'GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.

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

Using git push --set-upstream origin master works fine in the terminal. What is going wrong here? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions