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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm having a similar issue with Bitbucket Server. Is it possible that this has something to do with a recent security patch?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.