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

BITBUCKET_GIT_SSH_ORIGIN variable not set on Windows

AlexanderS December 16, 2022

Hello,

I'm trying to configure build using bitbucket pipelines on self-hosted Windows machine. 

However, I can't access SSH repository URL via "BITBUCKET_GIT_SSH_ORIGIN" variable like in this example:

git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}
I tried "git remote set-url origin $BITBUCKET_GIT_SSH_ORIGIN" and also "echo BITBUCKET_GIT_SSH_ORIGIN". The latter command was supposed to print git repository SSH url but it didn't. 
It looks like this variable is not defined for Windows. I managed to workaround this by setting SSH url directly in the bitbucket-pipelines.yml file. 
Has anyone experienced the same issue? Is there a way to access SSH url on Windows?
Thanks in advance.

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 19, 2022

Hi @AlexanderS,

Windows Runners use PowerShell and environment variables in PowerShell can be accessed with $env:variable_name. So, you can access this variable with $env:BITBUCKET_GIT_SSH_ORIGIN

Please feel free to let me know if this works for you and if you need anything further.

Kind regards,
Theodora

AlexanderS December 19, 2022

It works, thanks a lot!

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 19, 2022

That's good to hear, you are very welcome!

Please feel free to reach out if you ever need anything else.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events