Reputation: 158
I have access to repo, I clone it by https, then I made my changes and I commit those change and create new_branch
and try to push I got this:
git push origin new_branch
remote: Forbidden
fatal: unable to access 'https://[email protected]/main-account/repo.git/': The requested URL returned error: 403
I already setup my SSH key, git global config and already logged
ssh -T [email protected]
logged in as username
You can use git or hg to connect to Bitbucket. Shell access is disabled
also, I tried to change the url
git remote set-url origin [email protected]:main-account/repo.git
and when I push I got this
git push origin new_branch
Forbidden
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and finally my ~/.ssh/config
Host *
UseKeychain yes
Host bitbucket.org
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Any help? Thanks in advance
Upvotes: 4
Views: 16181
Reputation: 1
To check, you can: log into Bitbucket > Profile & settings > Personal setting > App Passwords > Select / grant required access. > ne token will be generated for you. Make a note of that and use it when you upload / push code to bitbucket.
Upvotes: 0
Reputation: 1
Make sure you have an access on Bitbucket.
To check, you can: log into Bitbucket > Profile & settings > Personal setting > App Passwords > Select / grant required access.
Upvotes: 0
Reputation: 1329162
Make sure that username
and main-account
are the same: you need to push back to a repository that you own (have created as username)
Or you need to have been granted repository access to username
by their owner main-account
.
Upvotes: 1