-
-
Notifications
You must be signed in to change notification settings - Fork 954
-
EDIT:
Error creating remote: Cmd('git') failed due to: exit code(128)
cmdline: git fetch -v origin
stderr: 'fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.'
THIS IS WHERE I AM AT:
try:
ssh_cmd = 'ssh -i ' + token
for branch in repo.branches:
with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):
remote = repo.create_remote('origin', url='git@github.com:' + git_config.get_value('user', 'name') + '/' + project_name)
assert repo.remotes.origin.exists()
assert repo.remotes.origin == repo.remotes.origin == repo.remotes['origin']
repo.remotes.origin.fetch()
repo.create_head('master', origin.refs.master).set_tracking_branch(origin.refs.master).checkout()
repo.remotes.origin.push()
except exc.GitCommandError as error:
print(f'Error creating remote: {error}')
I'm getting an error:
repo.remote.origin.push()
Error creating remote: Cmd('git') failed due to: exit code(128)
cmdline: git push --porcelain origin
stderr: 'fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin master
'
any help with this? I'm stuck.
Beta Was this translation helpful? Give feedback.
All reactions
What about repo.remote.origin.push(set_upstream=True)
?
Replies: 1 comment 2 replies
-
What about repo.remote.origin.push(set_upstream=True)
?
Beta Was this translation helpful? Give feedback.
All reactions
-
you took too long to reply and I just uninstalled this and added a different one. Sorry
Beta Was this translation helpful? Give feedback.
All reactions
-
I am glad to hear that you found a workaround.
Beta Was this translation helpful? Give feedback.