Last active
April 18, 2022 16:58
-
-
Save caffeinetiger/d26fc5ecaa68f98a0f9f4a01546df6ee to your computer and use it in GitHub Desktop.
References:
- [Bitbucket clone: Port number ended with 'T'](https://stackoverflow.com/questions/47076616/bitbucket-clone-port-number-ended-with-t?msclkid=91ff37c1b49c11ecad515ceb6e0a828e)
- [Decoding URL encoding (percent encoding)](https://unix.stac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BITBUCKET_USERNAME=someperson | |
BITBUCKET_PASSWORD=somepassword | |
mkdir some-dir | |
# The follow command works by default in Amazon Linux 2 out of the box for Python 2.7.x | |
# App passwords need to be URL encoded to work | |
URL_ENCODED_PASSWORD=$(python -c "import urllib;print urllib.quote(raw_input())" <<< "${BITBUCKET_PASSWORD}") | |
git clone https://${BITBUCKET_USERNAME}:${URL_ENCODED_PASSWORD}@bitbucket.org/sometreamorg/somerepo.git some-dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment