Git – initial use of bitbucket and problem solving

Time:2019-12-2

Initial use of bitbucket and problem solving

Build remote version Library

Creating a remote version library is very simple as follows:

Git - initial use of bitbucket and problem solving

Git - initial use of bitbucket and problem solving

The remote version library created is as follows:

Git - initial use of bitbucket and problem solving

Add public keySSH-KEYTo Bitbucket

How to createSSH-KEYCan you do Baidu for a while, and have a little enterprising spirit, just as I didn’t say!

Git - initial use of bitbucket and problem solving

OpenAdd SSH keyInput in windowLabelName:

Git - initial use of bitbucket and problem solving

To open the.ssh -> id_rsa.pubFile, copy file contents paste toKeyIn text box:

Git - initial use of bitbucket and problem solving

Git - initial use of bitbucket and problem solving

Git - initial use of bitbucket and problem solving

Add public keySSH-KEYAfter bitbucket, it is as follows:

Git - initial use of bitbucket and problem solving

Add bitbucket remote version library address in local version Library

ChoiceSourceClick to select the address link on the right asSSHCopySSHRemote version library address for

Git - initial use of bitbucket and problem solving

Add remote version library address under local version Library:

shell> git remote add origin-for-bitbucket [email protected]:wushaohua/warnerwu-using-bitbucket-repo-manage-test.git

Git - initial use of bitbucket and problem solving

Push local version library to remote

Push local version library to remote and associate after adding remote version library address

shell> git remote origin-for-bitbucket master

The above is how to build a remote version library and addSSH KEYPublic key information, add remote version library address information to local version library

There is no problem to push the local version library to the remote normal process!

Unfortunately, it failed! The GIT console output the following information:

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.

Git - initial use of bitbucket and problem solving

Later, I found out why I was so old,

This is what other version library providers do. There is no problem in the use process,

Why?BitbucketWhat about going up?

Take this question and find out on the official website,

findBitbucketOfSSH KEYYesdeployment keythat isDeployment keyandaccount keythat isAccount keyPoints,

alsodeployment keyIt is read-only.secret key

That’s what we added aboveSSH KEYIt is adeployment keythat isDeployment key,

Therefore, it fails to push the local version library to the remote version library

Add toaccount key Account key

Git - initial use of bitbucket and problem solving

Git - initial use of bitbucket and problem solving

Add toaccount keyAnd the topdeployment keyThe method is the same, and theSSH KeyIt’s the same,

That is, under the user directory.ssh -> id_rsa.pubDocument content

Git - initial use of bitbucket and problem solving

But unfortunately, addingaccount keyFailed because there is already a registered deployment key,

We have todeployment keyDelete and addaccount key, note that ifaccount keyYou don’t have to add it againdeployment keyNow,

Just startedBitbucketYesdeployment keyI really don’t know. I don’t know where and when to use it. If you know, please let me know. Thank you very much

Add toaccount keyThen push the local version library to the remote version library, which is very smooth!

Git - initial use of bitbucket and problem solving