Skip to content

Instantly share code, notes, and snippets.

@mfcovington
Created May 1, 2012 22:54
Show Gist options
  • Save mfcovington/2572132 to your computer and use it in GitHub Desktop.
Save mfcovington/2572132 to your computer and use it in GitHub Desktop.

#Bitbucket Tutorial for UCD PlantBio Perl Club

###What is Bitbucket?

Like github, bitbucket is a web-based bosting service for git repositories (bitbucket hosts Mercurial repositories, too). As a research group at a university, a very attractive feature of bitbucket is that accounts created with an email address from an educational institution are automagically upgraded to unlimited private respositories and private collaborators. Only paid github accounts have access to privacy.

###Goal of this Tutorial

  • Create an empty git repository on bitbucket
  • Make a local clone of the repository and add some content
  • Share the repository with collaborators

###Create an empty git repository on bitbucket

  1. If you don't already have a bitbucket account, create one.
    • Use your .edu email address. You can assign an additional email address later if you wish.
  • Goto bitbucket.

  • Click Repositories/create repository.

    • Bitbucket enables the use of keyboard shortcuts. To create a repository, you can also type grcr (which appears to stand for "goto repository menu" and "create repository").
  • Enter a name for the repository. For example: perlclub_demo (Don't use spaces!).

  • Since we are making a git repo, leave Git checked. Leave Private checked unless you want to make a public repo.

  • For this tutorial, go ahead and check both Issue tracking and Wiki so that we can become familiar with these features.

  • The next step is to select a language. As far as I know, this currently has no real function. This is the language for the entire repo, not a specific file. Just choose the most prominent programming language used in your project. For our purposes, we will choose 'Perl'.

  • You can enter a description and website for the project now or later.

  • Click Create Repository.

###Make a local clone of the repository and add some content

  1. Open Terminal.app
  • Change to the directory that contains your git repos.
    • If you don't have any git repos, I suggest making a new directory in yur home directory: mkdir ~/git.repos. Then go into this directory (cd ~/git.repos).
  • On the overview page of your new git repo on bitbucket, you should see an area that says "Clone this repository" that has a snippet of code that looks similar to git clone git@bitbucket.org:mfcovington/perlclub_demo.git.
  • To clone the empty bitbucket repo onto your computer, paste this snippet into your Terminal window. You will need to enter your bitbucket credentials.
  • In this case, a new directory containing the repository and accompanying files will be created in ~/git.repos/perlclub_demo.
  • (add content, commit, push to remote bitbucket repository)

###Share the repository with collaborators

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment