Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Trying to push HW assignment via Git cmd/bash. Issue

Jordan Caswell July 2, 2023

I am trying to push a file from via Git CMD/Bash and I recently had to change my SSH key and create a new one. I deleted my old key and made a new one to replace it. I am currently trying to push something after successfully setting up the new key. I receive a prompt for my password when I am pushing my file and I enter the password correctly and I receive the error, "remote: Invalid credentials
fatal: Authentication failed for   ______."

I am unsure how to go about this I am just trying to push this file to my repository. Thank you for the assistance in advance.

 

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 4, 2023

Hi Jordan and welcome to the community!

You mentioned SSH keys, however, the message in the output normally shows when HTTPS authentication is used.

If you navigate to the directory of your clone and run the following command:

git remote -v

does the URL of the repo in the output start with https:// or with git@bitbucket.org ?

If it starts with https://, you will need to change it to an SSH URL in order to use SSH.

You can do that with the command

git remote set-url origin git@bitbucket.org:workspace-id/repo.git

where

origin replace with the name of your remote, if it is different than origin. The name of your remote shows in the output of git remote -v
workspace-id replace with the id of the workspace this repo belongs to
repo replace with the sluf of your repo


If you are using OpenSSH as an SSH client, I would also recommend updating the ~/.ssh/config file on your machine with the following:

Host bitbucket.org
AddKeysToAgent yes
IdentityFile ~/.ssh/{ssh-key-name}

where {ssh-key-name} replace with the name of the private SSH key, whose public key you have added to Bitbcuket.

This will ensure that this specific SSH key will be used every time you clone, pull, or push to a Bitbucket Cloud repo via SSH.

Please feel free to reach out if you have any questions.

Kind regards,
Theodora

Jordan Caswell July 4, 2023

Hi, I resolved my issue. Uninstall and reinstall solved my issue. Thank you for the response.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2023

That's good to hear Jordan, thank you for the update. Please feel free to reach out if you ever need anything else.

0 votes
Jordan Caswell July 2, 2023

help.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events