Github Desktop For Bitbucket

Estimated reading time: 4 minutes

  1. Github Desktop Bitbucket Captcha
  2. Github Vs Bitbucket
  3. Bitbucket To Github Migration

I'm using a Bitbucket repo in GitHub Desktop for Mac. Since Atlassian changed my password, GitHub Desktop can't log in anymore and doesn't give me opportunity to provide new password. It says 'Check preferences to make sure you're still logged in', but preferences only talks about GitHub account. I'm able to push using command-line git.

To automate building and testing of your images, you link to your hosted sourcecode service to Docker Hub so that it can access your source coderepositories. You can configure this link for user accounts ororganizations.

The GitHub for Windows application has great integrated support for BitBucket (as can be expected), however it can work as a generic Git client just fine. This will allow us to use it with BitBucket. Creating a repository on BitBucket. The new sign in screen on BitBucket.org surprised me. If what you want is using Github App for pushing your code to Bitbucket what you need to do is going to 'Settings' (in your local repo) and change your Primary remote repository (origin) to point to Bitbucket in your Github App. Then you can Sync Branch. GitHub usually is a hub for git version control. On the other side, BitBucket supports more than just git. Mercurial is another version control management system that can track your repositories. It does not support SVN, another major system, but at least with Bitbucket, you have a choice. The workflow below adds the github repository as a a new remote called sync and the bitbucket remote as origin. It also adds a branch called github to track the github repository and a branch called master to track the bitbucket repository. It assumes you have a bitbucket repository called 'myrepository' which is empty.

Note: If you are linking a source code provider to create autobuilds for a team, follow the instructions to create a service account for the team before linking the account as described below.

Link to a GitHub user account

  1. Log in to Docker Hub using your Docker ID.

  2. Click Account Settings in the top-right dropdown navigation, then open Linked Accounts.

  3. Click Connect for the source provider you want to link.

  4. Review the settings for the Docker Hub Builder OAuth application.

    Note: If you are the owner of any GitHub organizations, you might see options to grant Docker Hub access to them from this screen. You can also individually edit an organization’s third-party access settings to grant or revoke Docker Hub’s access. See Grant access to a GitHub organization to learn more.

  5. Click Authorize docker to save the link.

Link to a Bitbucket user account

  1. Log in to Docker Hub using your Docker ID.

  2. Click Account Settings in the top-right dropdown navigation, then openthe Linked Accounts section.

  3. Click Connect for the source provider you want to link.

  4. If necessary, log in to Bitbucket.

  5. On the page that appears, click Grant access.

Unlink a GitHub user account

To revoke Docker Hub’s access to your GitHub account, you must unlink it bothfrom Docker Hub, and from your GitHub account.

  1. Click Account Settings in the top-right dropdown navigation, then openthe Linked Accounts section.

  2. Click the plug icon next to the source provider you want to remove.

  3. Go to your GitHub account’s Settings page.

  4. Click Applications in the left navigation bar.

  5. Click the .. menu to the right of the Docker Hub Builder application and select Revoke.

Note: Each repository that is configured as an automated build sourcecontains a webhook that notifies Docker Hub of changes in the repository.This webhook is not automatically removed when you revoke access to a sourcecode provider.

Grant access to a GitHub organization

If you are the owner of a GitHub organization, you can grant or revoke DockerHub’s access to the organization’s repositories. Depending on the GitHuborganization’s settings, you may need to be an organization owner.

If the organization has not had specific access granted or revoked before, youcan often grant access at the same time as you link your user account. In thiscase, a Grant access button appears next to the organization name in thelink accounts screen, as shown below. If this button does not appear, you mustmanually grant the application’s access.

To manually grant Docker Hub access to a GitHub organization:

  1. Link your user account using the instructions above.

  2. From your GitHub Account settings, locate the Organization settingssection at the lower left.

  3. Click the organization you want to give Docker Hub access to.

  4. From the Organization Profile menu, click Third-party access.

    The page displays a list of third party applications and their access status.

  5. Click the pencil icon next to Docker Hub Builder.

  6. Click Grant access next to the organization.

Revoke access to a GitHub organization

To revoke Docker Hub’s access to an organization’s GitHub repositories:

  1. From your GitHub Account settings, locate the Organization settings section at the lower left.

  2. Click the organization you want to revoke Docker Hub’s access to.

  3. From the Organization Profile menu, click Third-party access. The page displays a list of third party applications and their access status.

  4. Click the pencil icon next to Docker Hub Builder.

  5. On the next page, click Deny access.

For

Unlink a Bitbucket user account

To permanently revoke Docker Hub’s access to your Bitbucket account, you mustunlink it both from Docker Hub, and from your Bitbucket account.

  1. Log in to Docker Hub using your Docker ID.

  2. Click Account Settings in the top-right dropdown navigation, then openthe Linked Accounts section.

  3. Click the plug icon next to the source provider you want to remove.

  4. Go to your Bitbucket account and click the user menu icon in the top-right corner.

  5. Click Bitbucket settings.

  6. On the page that appears, click OAuth.

  7. Click Revoke next to the Docker Hub line.

Note: Each repository that is configured as an automated build sourcecontains a webhook that notifies Docker Hub of changes in the repository. Thiswebhook is not automatically removed when you revoke access to a source codeprovider.

Docker, docker, registry, accounts, plans, Dockerfile, Docker Hub, trusted, builds, trusted builds, automated builds, GitHub

When it comes to Bitbucket and GitHub, each offers their advantages and disadvantages. I’ve used them both and like them each for different reasons.

But I prefer GitHub for a few more reasons than Bitbucket (the least of which is not that my organization was hosted there). And I like to have everything, more or less, under the same service.

I’ve spent some time over the past week migrating from Bitbucket to GitHub. I currently maintain two personal accounts:

  • one for myself,
  • one for Pressware.

I’ve opted to downgrade my organization account to a personal account to save money and because I’m more or a less a company of one who occasionally has collaborators.

Various guides online leave something to be desired when it comes to walking through how to go about migrating from Bitbucket to Github, so I thought I’d share my experience for doing that.

Migrating From Bitbucket to GitHub

First, in writing this, I’m assuming that you want to maintain two personal accounts each of which has their own GitHub account and thus their email address.

If that’s the case, then this should provide you with everything to need. I’m also assuming that you have two accounts set up – nothing moe (that is, no SSH keys or anything of the like).

Github Desktop Bitbucket Captcha

Desktop

In my examples, I’m using pressware as the username. You’ll need to replace this with whatever you like.

With that said, here’s what you need to do.

1. Generate an SSH Key

First, you’re going to need to generate an SSH key. Depending on the type of work you do, you may want to be careful with this. That is, if you have an existing id_rsa file, don’t overwrite it. Instead, we’ll create a second one.

To do this, open a terminal and enter the following replacing the specified email address with the email address of the second account that you’ve created (in my case, this is my pressware account as opposed to my tommcfarlin account).

View the code on Gist.

When it asks for the name of the file you want to use, suffix it with the username (or name it anything you like – I just happen to be a fan of doing it this way).

In my case, I’m saving the file to id_rsa_pressware. Next, specify whatever passphrase you’d like.

2. Add the Key to Your Local Agent

Next, you’re going to need to add the key to your SSH agent. All of this is necessary to we can communicate with the proper GitHub account when it comes time to start migrating from Bitbucket to GitHub.

To do this, enter the following command in your terminal:

View the code on Gist.

This will start the ssh-agent program as a background process. After that, enter the next command:

View the code on Gist.

This will add the SSH private key and store the passphrase in your operating systems keychain.

3. Add the SSH Key to GitHub

Next, login to the GitHub account to which you’ll be migrating the repositories. In the account, click on your profile icon then click on the Settings menu item.

From there, choose the option for SSH and GPG Keys. After that, copy the contents of the newly created key to your clipboard. You can do this in the terminal with the following command:

Github Vs Bitbucket

View the code on Gist.

Next, click on the New SSH Key button and, on the following page, give the key whatever name you’d like and paste the contents that were just copied to your keyboard.

4. Migrate Your Repositories

To keep things succinct, I’m going to show how to copy a single repository from. Bitbucket but you’ll need to do this for as many repositories as you have to migrate.

First, on GitHub, create an empty repository with the same name as the one you’re going to be migrating. In the example below, I’ll simply use acme-repository.

Bitbucket To Github Migration

Next, enter the following command in your terminal:

View the code on Gist.

This will clone a mirror of the acme-repository to your Desktop. After that, navigate inside of the directory (by entering cd acme-repository.git).

Next, enter this command in your terminal:

View the code on Gist.

This will set a new upstream remote URL to which all of the repository contents should be pushed.

Github

After you’ve done that, it’s a matter of pushing the contents of the repository:

View the code on Gist.

Depending on the size of the repository, this may take a little bit of time, but the work is done.

Github

And That’s It

It would be easy to say “that’s all!” but it’s a bit of time-consuming work if you have multiple repositories, aren’t familiar with SSH, or are new to this whole thing.

But once everything is set up and organized, it’s much nicer to have everything on the same service if only separate by accounts.

Iphone lg tv screen mirroring

Finally, at the time of this writing, this is how I was migrating from Bitbucket to GitHub. Like other posts and articles online, this could easily be out of date within a few months.

I’ll do what I can do to keep it current. If you notice it’s out of date, don’t hesitate to let me know.