Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbucket git push as user

Tags:

git

bitbucket

1) I create a new repo on bitbucket using the main TEAM user.

2) Then i add all development keys that will be able to download this repo.

3) Went to a server and made a clone of this repo using the command:

git clone ssh://[email protected]/user/repo.git

4) I made some changes to the code and made the commit

git commit -a -m "some improves"

So here's the Question:

I can't do a git push bec i don't have push right to do that with this user:

# git push
conq: repository access denied. access via a deployment key is read-only.
fatal: The remote end hung up unexpectedly

So, how can i make a push using my username/password?

like image 957
diego2k Avatar asked Mar 01 '13 21:03

diego2k


2 Answers

You could always setup a second remote on your server using https:

git remote add edit-only-origin https://bitbucket.org/user/repo.git

Then, you could make small edits, commit and then use the command

git push edit-only-origin

This would prompt you for both your username and password.

like image 102
Marcus Avatar answered Sep 28 '22 11:09

Marcus


From my understanding, deployment key is for read-only access. To be able to push, you need to add your computer's ssh key.

Go to Manage Account, and on the left, choose SSH keys. Add key by copy and pasting your rsa.pub public key.

It's better if you copy it from terminal to make sure no funky characters get in the mix. To do so in OSX, type pbcopy < ~/.ssh/id_rsa.pub. For Linux, look at Agush's comment.

like image 27
yeesterbunny Avatar answered Sep 28 '22 11:09

yeesterbunny