- 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://email@example.com/c2c/testrepo.git Cloning into 'testrepo'... Password for 'https://firstname.lastname@example.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://email@example.com/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!
- How to ignore files in git using .gitignore file
- How to update expired GitHub token on local git remote config
- How to undo last Git Commit on Local Repository?
- Git Commit - Author identity unknown, Please tell me who you are email
- Git: Step-by-Step - How to Push Local Brach to GitHub
- [Solution] fatal: not a git repository (or any of the parent directories): .git
- Remove git config at Local, Global or System Levels?
- Change the default git branch name from master to main
- fix fatal: --local can only be used inside a git repository error
- Git Remove Untracked Files using Command
- How to remove or unstage a file from git staged area
- Fix Git: Warning: could not find UI helper GitHub.UI on Windows
- Fix [oh-my-zsh] Cant update: not a git repository
- Get List of all local branches git command
- Github: fatal: Authentication failed Support for password was removed on August 13, 2021
- [fix] fatal: this operation must be run in a work tree in git
- How to Install Git on Windows
- Perform an Empty Commit in Git without anything in Staging Area
- Rename git branch on Local and GitHub Remove using Command
- Fix: error: could not lock config file /etc/gitconfig: Permission denied
- Get the file location of git config values
- Git: Delete Branch Locally and Remotely at Origin
- 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.
- Github: How to Invite Collaborators
- How to change directory in Git bash
- sudo is not recognized as an internal or external command - Windows
- Word-wrap Eclipse Console logs - Eclipse
- How to disable button in Bootstrap - Bootstrap
- Notepad++ sort by name with example - NotepadPlusPlus
- Enable macOS Stage Manager - MacOS
- Are Windows Notepad files recoverable? - NotepadPlusPlus
- Call a Stored Procedure using Java JDBC CallableStatement Example - Java
- How do I run HTML file in Notepad? (Windows) - NotepadPlusPlus