Prerequisite:
- Git installed on your Windows/Mac/Linux device.
- Access to a public or private Git Repos on BitBucket
How to clone a private BitBucket repository
The first step to start working on a project is to clone the git repository locally. If your project resides in BitBucket then below are the steps to clone the repo locally,
- Login to your BitBucket account,
- Go to your repository and click on the Clone button,
- Copy the git clone command.
- Now open your Terminal and run the command from the directory where you want to clone it.
$ git clone https://c2c@bitbucket.org/c2c/testrepo.git Cloning into 'testrepo'... Password for 'https://c2c@bitbucket.org': remote: Enumerating objects: 4, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (4/4), done. remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (4/4), 965 bytes | 193.00 KiB/s, done.

Note: For the Password to clone the repo, you would require to generate an App password
How to generate BitBucket App Password
- Login to BitBucket,
- Click on your account icon -> Personal Settings,
- Under sidebar ACCESS MANAGEMENT -> App passwords,
- Add a label, click on Create App Password, and select Repositories permission (read at least)
- Copy the Password, note you will not be able to view this password again once you close this window.
How to clone a public BitBucket repository
The steps to clone a public repo are the same as a private one, the only difference is you will not require a username and password to clone it.
Example:$ git clone https://code2care@bitbucket.org/code2care/myproject.git
Cloning into 'myproject'...
remote: Enumerating objects: 9, done.
remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 9
Unpacking objects: 100% (9/9), 725 bytes | 72.00 KiB/s, done.
Have Questions? Post them here!
- [Fixed] Git Clone git@github.com: Permission denied (publickey) Could not read from remote repository Fatal error
- Github: How to Invite Collaborators
- Git Commit - Author identity unknown, Please tell me who you are email
- [Solution] fatal: not a git repository (or any of the parent directories): .git
- [fix] zsh: command not found: git
- Github: fatal: Authentication failed Support for password was removed on August 13, 2021
- Get List of all local branches git command
- Git Revision Questions Before the Interview
- git fatal: Authentication failed error [fix]
- How to Install Git on Ubuntu Linux
- GitHub: How to Search Code
- How to change Git Default Author and Committer details in Eclipse
- How to check your installed version of Git
- Install GitHub Command Line Tool on Mac
- How to Merge Branch into Master Branch
- Perform an Empty Commit in Git without anything in Staging Area
- Git Fix: fatal: refusing to merge unrelated histories Error
- How to undo last Git Commit on Local Repository?
- git command to remove/unstage files from staging area
- Step-by-Step: Setting up Docker + Ubuntu Linux + Git + GitHub Tutorial
- Remove git config at Local, Global or System Levels?
- Fix [oh-my-zsh] Cant update: not a git repository
- Git Config Command - A Deep Dive
- fatal: Unable to create '/c/git_repo/.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier.
- How to change directory in Git bash
- Instant Run requires Tools | Android | Enable ADB integration to be enabled - Android-Studio
- How to display Java Date Time timezone GMT/UTC offset using SimpleDateFormat - Java
- Locate MainActivity Java or Kotlin file in Android Studio - Android-Studio
- How to Join Microsoft Teams Meeting Without an Account - Teams
- Install Notepad++ silently using Windows Powershell - NotepadPlusPlus
- Fix: Spring Boot: SQLException: Access denied for user root@localhost (using password: YES) - Java
- How to save macOS Terminal outputs as text file - MacOS
- Mac - Chrome Open a new window in Incognito mode - Chrome