Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to push from Windows to remote

Edited

Hi

I have Bitbucket server running on an AWS ubuntu instance.  I have my local repo on my Windows laptop and I sync with a local VirtualBox ubuntu VM.  I can push and pull from the command line on ubuntu.  I am very at home on Linux so I have no issue with remotes, upstream and ssh keys.

However, I have no idea how to push/pull on the Windows command line.  

PS C:\> git branch -vv
* feature 34cd7bc [origin/feature: ahead 4] more git aliases
master 2e87266 [origin/master: ahead 1] config file updates

I am not logged onto Windows as the same user that I use on ubuntu that has access to bitbucket server.   How do I tell git on windows to connect as a specific user and tell it which private key to use?  I have loaded the private keys in pageant.

I have tried (note.  ip address redacted)

PS C:\> git push ssh://git@ec2-xx-xx-xxx-xxx.us-west-2.compute.amazonaws.com:7999/~git/project1.git

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Anyone?

Thanks

 

 

 

1 answer

0 votes
Mikael Sandberg Community Leader Jan 22, 2020

If you are using SSH to connect to you Bitbucket repository you need to either reuse the key you have on Ubuntu, or generate a new one for Windows. Have a look at Set up an SSH key on how to do it on Windows.

Hi

Thanks, yes I get that I have to resuse my key and I do have my private key on Windows.  The bit of this puzzle that I am missing is how to tell the git command in Windows to use the private key which is in %userprofile%/.ssh/id_rsa.

Regards

A

Mikael Sandberg Community Leader Jan 23, 2020

It depends on how your profile is set up. If it defaults to %userprofile%, then just add the .ssh directory under there. If your IT have your user profile somewhere else then under c:\users you can find out where ssh is looking for the key by running this command:

ssh -vT <bitbucket URL>

Leave out the port number, and at the end of the output from ssh it will ask you to log on, just exit the command without doing that.

Hi Mikael

Thanks as per above my key is already here

%userprofile%/.ssh/id_rsa

I will test ssh later but I do not expect that to work because I do not have my public key on the bitbucket host.  I do not see why I would need it on the host.  I have of course  added the public key into my account in bucket server.

Mikael Sandberg Community Leader Jan 24, 2020

Correct, the public key only has to be on the server you are pushing to from your client, that is how Bitbucket/SSH figures out that you are you, even if you are logged in as a different user on your windows machine.

I'm having a similar issue with Bitbucket Server. Is it possible that this has something to do with a recent security patch?

 

https://confluence.atlassian.com/bitbucketserver/bitbucket-server-security-advisory-2020-01-15-985498238.html

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,755 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you