Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Source Control Using Atlassian Bitbucket

DZone's Guide to

Source Control Using Atlassian Bitbucket

This tutorial shows you how to use source control for your project's Git repositories using Atlassian Bitbucket.

Free Resource

The Nexus Suite is uniquely architected for a DevOps native world and creates value early in the development pipeline, provides precise contextual controls at every phase, and accelerates DevOps innovation with automation you can trust. Read how in this ebook.

What Is Bitbucket?

Bitbucket is a web-based hosting service that distributes source code and development projects. They are offering free accounts for up to five members in a single team and we can create an unlimited number of private repositories. We can upload the source code from GitHub and Visual Studio.

bitbucketFeatures

  • Pull requests with code reviews and comments
  • Merge code checks
  • Tracking
  • Wikis
  • More add-ons
  • Team monitoring

Step 1

Create a new account on the Atlassian Bitbucket site from here. You can also use a social network to sign up. After the login page, it should appear like the picture below.
bitbucket

Step 2

Create your new project team from navigation header- Teams> Create Teams.

bitbucket

Add team members using their Bitbucket username or email address and manage the groups.

Step 3

Create your new projects from the navigation header- Projects> Create project.

bitbucket

Select your team or account username on Owner List. This project can be accessed only by your team. For that, click privacy check.

Step 4

Create your new repository in the navigation header- Repositories> Create repository.

bitbucket

Make sure to select the repository owner and project in the list. If you need more features, click “Advanced Settings” and it should expand the page like the picture below.
bitbucket

Once you have checked the Issue tracking checkbox, if there are any issues in the developing project stage, you can follow the team member suggestions and comments. This can reduce the dependency on external tracking tools.

Step 5

If you have already built the source code in GitHub, click "import repository," or you may go to the navigation header- Repositories> Import repository

bitbucket

Login to the GitHub site and copy your project URL. Paste it into the URL textbox. After clicking the "import repository" button, the project will locate a Bitbucket project list for the selected team.

Step 6

We have one more option: to upload it directly from Visual Studio. Open Visual Studio 2017 and create a new project with the name of your choice. I will show the demo as a Windows application:

VS 2017>New Project >choose Windows Application
bitbucket

The project will be created like the picture below.
bitbucket

Before uploading, the project shows up without a lock symbol.

bitbucket

Now, right click above the project and click “Add Source to Source Control.”
bitbucket

This action will make the lock symbol appear near all the project files.
bitbucket

Then, go to the team explorer window and click the “Sync” button under the project.

bitbucket

The first time, it will take you to the “Publish” window. Select "publish to remote repository," then click “Publish Git Repo.” It shows one textbox copied from the repository URL.

bitbucket

Paste that in the textbox and click on the “publish” button.
bitbucket

Meanwhile, it may ask your login credentials.
bitbucket

Now the project source code appears in the repository.

bitbucket

Step 7

Suppose you want to delete the repository; go to the Settings menu, then scroll down to the bottom of the page. Locate the “Delete Repository” button. Once you click the button, a popup window will appear.

Copy and paste the URL to the end of the repository name. Then, click the “Delete” button. It will automatically remove your repository list. 

bitbucket

In this article, we have seen source control using Atlassian Bitbucket. If you have any queries, please tell me through the comments section.

Happy coding...

The DevOps Zone is brought to you in partnership with Sonatype Nexus.  See how the Nexus platform infuses precise open source component intelligence into the DevOps pipeline early, everywhere, and at scale. Read how in this ebook

Topics:
source control ,bitbucket ,tutorial ,devops ,version control ,revision control

Published at DZone with permission of Thiruppathi Rengasamy, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}