Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

git - Bitbucket access keys can only be used for read-only?

First time using bitbucket, trying to make a first push of my local project to bitbucket.

I managed to create a repository with no issues. After I created a new SSH Key, which I loaded to both Bitbucket and also Pagent (that is running in my windows background).

Still when I try to push my commit to Bitbucket I get the following:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin master:master
Pushing to user@bitbucket.user/repository.git
repository access denied. access via a deployment key is read-only.
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.

On Bitbucket -> Project -> Settings -> Access Keys: It says here, copying and pasting as it is:

Use access keys to gain read-only access to this repository. Learn more about using SSH keys.

Does this mean I can not use SSH Keys to make a push to the repository?
PS: I tried all the solutions that were available to sort out this issue, still I get the same error (regenerated the keys, tried both SourceTree or GitShell to make the push, still same error coming up); any other ideas are welcomed

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I managed to finally make a push through git shell, by creating a new key where you specified (Acc->Security->SSH Keys); still does not seem to want to work with SourceTree

Check if SourceTree is configured to use the embedded git or the system Git (the latter being the one you have installed. And make sure your SourceTree runs with your account.

The OP Marin adds in the comments:

I managed to do all that in the end after setting a new ssh key for the account not the project and adding it to Pagent.

I managed to sort the issue quite quickly after the initial commit and push through Git Shell, I just checked out the repository using SourceTree and it worked (also my account was already linked to SourceTree)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...