Day 53: Setting up a Repository

Creating a repository in Bitbucket

Creating a repository in Bitbucket is a straightforward process. Here are the steps to create a new repository:

  1. Log in to your Bitbucket account and navigate to the dashboard.
  2. Click on the “Create” button located in the top right corner of the page.
  3. Select “Repository” from the dropdown menu.
  4. Choose whether you want to create a repository for Git or Mercurial, depending on your preference.
  5. Enter a name for your repository and provide an optional description.
  6. Choose whether you want your repository to be public or private.
  7. If you’re creating a Git repository, select whether you want to initialize it with a README file or not.
  8. Click on “Create Repository”.

That’s it! You’ve successfully created a new repository in Bitbucket. You can now add files, invite collaborators, and start working on your project.

Cloning a repository locally

Cloning a repository from Bitbucket to your local machine is a great way to work on your code locally and keep it in sync with the remote repository. Here are the steps to clone a repository:

  1. First, make sure you have Git installed on your local machine.
  2. Log in to your Bitbucket account and navigate to the repository you want to clone.
  3. Click on the “Clone” button located in the top right corner of the page.
  4. Select whether you want to use HTTPS or SSH as your cloning protocol, depending on your preference.
  5. Copy the URL provided by Bitbucket.
  6. Open up your terminal or command prompt and navigate to the directory where you want to store your cloned repository.
  7. Type in git clone followed by the URL you copied earlier, then hit Enter.
  8. Git will now download all of the files from the remote repository and create a new directory containing all of these files in your local machine’s file system.

That’s it! You’ve successfully cloned a repository from Bitbucket to your local machine using Git.

Adding files to the repository

Adding files to a Bitbucket repository is a simple process. Here are the steps to add files:

  1. Navigate to the repository you want to add files to.
  2. Click on the “Upload files” button located in the top right corner of the page.
  3. Select the file(s) you want to upload from your local machine and click “Open”.
  4. Once all of your desired files have been selected, click on “Commit changes” at the bottom of the page.
  5. In the following screen, you can add a commit message describing what changes were made in this commit.
  6. Optionally, you can also create a new branch for these changes if needed.
  7. Finally, click on “Commit”.

That’s it! You’ve successfully added new files to your Bitbucket repository.