Blog

How to Make a Private Repository from a Cloned Bitbucket Repository 

Introduction 

Managing source code repositories effectively is crucial for security, collaboration, and version control. When working with Bitbucket, you might need to create a private repository from an existing clone to protect sensitive information or limit access. This guide walks you through the steps to achieve this efficiently while ensuring seamless Jira consulting integration for issue tracking and project management.

Why Make a Repository Private? 

Making a repository private is essential for several reasons: 

  • Security: Prevent unauthorized access to your code. 
  • Compliance: Ensure that sensitive code is not publicly available. 
  • Collaboration Control: Grant access only to specific team members. 
  • Intellectual Property Protection: Keep proprietary code private. 

Step 1: Clone the Existing Repository (If Not Already Cloned) 

Using the Command Line 

Prior to cloning or interacting with a Bitbucket repository using Git, you’ll need to either: 

  • Install the Git Credential Manager (included with Git for Windows) 

You can use Sourcetree, Git from the command line, or any client you like to clone your Git repository. These instructions show you how to clone your repository using Git from the terminal. 

Clone a Repository via HTTPS 

  1. Navigate to the repository in Bitbucket and select Clone
  1. Copy the HTTPS clone command. 
  1. Open a terminal and navigate to the directory where you want to clone the repository. 
  1. Paste and execute the command: git clone https://username@bitbucket.org/your-repository.git 
      
  1. If prompted, log into Bitbucket and authorize the connection. 

Clone a Repository via SSH 

  1. Ensure your public key is added to Bitbucket and loaded on your system. 
  1. Copy the SSH clone command. 
  1. Run the following command in your terminal: git clone git@bitbucket.org:your-repository.git 
      

Using Sourcetree 

  1. Open Sourcetree
  1. Select Clone
  1. In the Clone this repository dialog, choose Clone in Sourcetree
  1. Select the destination path and bookmark name. 
  1. Click Clone. Sourcetree will create and manage the repository locally. 

Using VS Code 

  1. Open Visual Studio Code
  1. Select Clone from the repository page in Bitbucket. 
  1. Choose Clone in VS Code
  1. Install the Atlassian for VS Code extension if prompted. 
  1. Select a storage location and click Clone
  1. Open the repository in VS Code and start working. 

Step 2: Create a New Private Repository on Bitbucket 

  1. Log in to Bitbucket at bitbucket.org
  1. Click on Repositories in the top menu. 
  1. Click on Create Repository
  1. Fill in the repository details:  
  1. Repository Name: Choose a meaningful name. 
  1. Repository Type: Select Git or Mercurial. 
  1. Privacy: Select Private to restrict access. 
  1. Click Create Repository to finalize the setup. 

Step 3: Update the Remote URL to Point to the New Private Repository 

After creating the private repository, update your cloned repository to push changes to the new private repository. Run the following command to set the new remote repository: 

git remote set-url origin https://bitbucket.org/your-username/new-private-repository.git 
  

To verify the new remote URL, run: 

git remote -v 
  

This should display the updated remote pointing to the new private repository. 

Step 4: Push Code to the New Private Repository 

To transfer all existing code from the cloned repository to the new private repository, run: 

git push -u origin –all 
  

This command pushes all branches to the new repository. Next, push all tags: 

git push -u origin –tags 
  

This ensures all versioned releases are also moved to the new private repository. 

Read more: Accelerating Team Productivity with Atlassian Intelligence 

Step 5: Verify the New Private Repository 

Once the push is complete, navigate to your new private repository on Bitbucket and confirm: 

  • All files and branches are present. 
  • The repository is marked Private
  • Only authorized users have access. 

Step 6: Manage Repository Access (Optional) 

You can control who has access to your private repository by: 

  1. Navigating to Repository Settings
  1. Selecting User and Group Access
  1. Adding specific users or teams and assigning permissions (Read, Write, Admin). 

Also read : Jira Reporting and Analytics

Conclusion 

By following these steps, you have successfully created a private repository from a cloned Bitbucket repository. This ensures that your code remains secure, access is controlled, and sensitive information is protected. Whether using Git CLI, Sourcetree, or VS Code, managing your repositories properly is a best practice for security, compliance, and efficient team collaboration. 

About MicroGenesis 

MicroGenesis, a leading Atlassian Platinum Partner and the Best IT Company, provides expert solutions for DevOps, Agile, and IT Service Management. With extensive experience in Bitbucket, Jira, and CI/CD integrations, we help organizations streamline software development, improve collaboration, and enhance security. Our team of experts offers end-to-end support, including repository management, security best practices, and automation strategies to help businesses achieve operational excellence. Contact us to learn more about how we can optimize your Bitbucket environment for efficiency and scalability.

Explore Related Insights

Salesforce Implementation Partner

From strategy to go-live — and beyond

As your dedicated Salesforce implementation partner, MicroGenesis delivers full-lifecycle implementations using a structured, low-risk methodology designed to get you to value quickly and keep you there through every phase of growth.

1. Discovery & Advisory

Workshops with your Salesforce consulting team to map processes, define goals, and shape a clear CRM roadmap.

2. Solution Design

Architecture, data model, and configuration blueprint crafted by certified Salesforce consultants aligned to your requirements.

3. Build & Configure

Declarative setup plus custom development across Sales, Service & Experience Cloud — built to Salesforce best practices.

4. Data & Integration

Secure data migration and Salesforce integration with your existing enterprise systems, delivered by our Salesforce integration partners team.

5. Testing & QA

Functional, integration, and user acceptance testing for a reliable, low-risk rollout of your Salesforce environment.

6. Deployment & Go-Live

Controlled release with cutover planning and hypercare support during the critical first days post-launch.

7. Training & Adoption

Enablement and change management from your Salesforce consulting firm to drive confident, lasting user adoption.

8. Managed Support

Ongoing 24×7 L1–L3 Salesforce managed support and continuous improvement for your live org.

Salesforce Managed Support

24X7 L1, L2 & L3 Salesforce support

Keep your Salesforce environment healthy, secure, and continuously improving with always-on managed support across all three tiers – delivered by our Salesforce partner team under clear SLAs.

24 X 7 X 365 Salesforce support coverage with defined SLAs and escalation paths

L1 : First Line

Day-to-day user support & monitoring
  • Ticket logging, triage & tracking
  • User access, login & password assistance
  • Basic how-to and navigation support
  • System monitoring and known issue resolution
  • Escalation to L2/L3 teams when required

L2: Functional

Configuration & Advanced Troubleshooting
  • Configuration changes and administrative tasks
  • Flow, validation rule, and automation troubleshooting
  • Reports, dashboards, and data issue resolution
  • Salesforce integration and synchronization diagnostics
  • Root cause analysis and issue resolution

L3: Engineering

Custom Development & Deep Expertise
  • Apex, Lightning Web Components (LWC), and custom code troubleshooting
  • Complex Salesforce integration engineering and support
  • Performance optimization and scalability tuning
  • Enhancements and new feature development
  • Vendor escalation management and coordination