I'm using sourcetree to push my changes up to my repo. The issue I'm getting is that when I push to the repo I get this error
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v origin master:master
warning: encountered old-style '//wsl$/Ubuntu-20.04/home/workspace/projects/laravel-project' that should be '%(prefix)///wsl$/Ubuntu-20.04/home/workspace/projects/laravel-project'
Pushing to bitbucket.org:cerberuspup/laravel-project.git
Unauthorized
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Completed with errors, see above.
and as far as I'm aware the repo does exist and I should have access rights
CodePudding user response:
Try checking your remote repos to see if those are the remotes you have access to with git remote -v
. That will show you the remotes and if you are pushing to the one you think you have access to.
CodePudding user response:
Type in git remote -v
to make sure you in the right directory and right git repository.
Make sure you have repository privilege to push files (contributer / owner)
If you are, type in ssh-keygen -t rsa -b 4096 -C "yourmail@yourmail"
You will be asked for passphrase, press enter few times.
After done, type in cat ~/.ssh/id_rsa.pub
Copy all output, Go to GitHub, Settings -> SSH and GPG -> ADD KEY, Paste your copied output.