79085839

Date: 2024-10-14 10:52:27
Score: 1
Natty:
Report link

Checking that a Git repository exists on Bitbucket:

  1. Create Bitbucket App Password, please refer to this link for more info --> How to Create Bitbucket App Password
  2. Use this command as follow:

git ls-remote https://{bitbucket_app_password}@bitbucket.org/{teamName_or_username}/{repo_name}

Note: the above command will return a reference to your repo if it exists, with the heads related to your available branches inside the repo.

Example of a returned repo reference: 6bd56aec730097365aca5caa\tHEAD\n3bc42968eed7aec730097365ace74a5caa\trefs/heads/dev\n9310985c619745780a206bfc6efba069\trefs/heads/master\n

Checking that a specific Branch exists inside a Git repository on Bitbucket:

  1. Create Bitbucket App Password, please refer to this link for more info --> How to Create Bitbucket App Password
  2. use this command as follow:

git ls-remote https://{bitbucket_app_password}@bitbucket.org/{teamName_or_username}/{repo_name} -b {branch_name}

Note:

Reasons:
  • Blacklisted phrase (1): this link
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Abdel-Raouf