Hi All,
I am trying to clone a python repository using the following code. I am trying to automate the process of cloning for certain automation tasks required for code analysis:
The problem
The error message
unable to access 'https://bitbucket.org/{workspace-name}/{repo-name}.git/': getaddrinfo()
...makes it clear that those two placeholders in the URL weren't replaced.
The fix
Change this:
repository_url = 'https://username@bitbucket.org/{workspace-name}/{repo-name}.git'
to the URL where you enter your actual workspacename and repository name:
repository_url = 'https://username@bitbucket.org/foo/bar.git'
To me it seems that the "username" part in the URL should also be replaced. At least I don't think that this is what you really want to use.
hi Aron.
i m trying to do the similar thing and getting the same error.
so the question is, where to get the exact url i need to pass as repository_url?
should we go to our repo -> clone -> and copy that link?
or just copy the link from browser?
also, why do we need to pass username in the base url? is it because it different when we clone manually vs when we do from python using subprocess?
ex: i see this when i go to bitbucket and click on clone and copy the link in ssh
ssh://git@bitbucketdc-ssh.mycompnay.net:1111/myproject/myrepo.git and can see in http like this
https://bitbucketdc.mycompnay.net/scm/myproject/myrepo.git
appreciate for any help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i though it might worth to put my solution here.
so when you try to add your url make sure to use f when you pass username and password as object.
like you have this
'https://{username}:{password}bitbucket.org/{workspace-name}/{repo-name}.git'
so if you have something like above, make sure to add f, otherwise it cant be readed and will throw error of :fatal: unable to access
so like this:
f"https://{username}:{password}bitbucket.org/{workspace-name}/{repo-name}.git"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.