Skip to end of metadata
Go to start of metadata

Learn everything you need to get started using Bitbucket with the Git distributed version control system (DVCS). This Bitbucket tutorial gives you a taste of developing with DVCS and Git using branches.

You might also be interested in:

Getting started with Bitbucket
Gives you the basics without the tutorial structure.

Getting Git Right
This is the place to learn more about all things Git.

Bitbucket Teams
Learn how Bitbucket teams make collaboration work.

Each part of this tutorial is designed to teach a new concept or complete a new task. Feel free to move ahead if you've already completed a task such as setting up Git or creating an account.


    1. Anonymous

      Great Tutorial Lars, Thanks for sharing.

  1. Anonymous

    Good tutorial. Makes it easy to use bitbucket. Thanks!

    1. Thank you! Always glad to hear this kind of comment. (big grin)

  2. Anonymous

  3. very good tutorial, I am switching from github and enjoying bitbucket and this tutorial. Very smooth and clean wording really amazing way. Thanks for producing such a detailed and easy tutorial specially for beginners.

  4. Anonymous

    Great tutorial, I spent a lot of time on it, but got pretty confused as my boss has me learning Mercurial and Bitbucket... learning git only confused me. One of the pages says something to the effect if you want to learn Mercurial with it (other than a few nods at Mercurial), "you're on your own."

    Would you consider having an alternate tutorial for Mercurial on it's own. For me, time is money and I wasted a bunch of time on Git.

    Otherwise, I am very impressed by the overall tutorial. Thanks for that!


    1. Kevin,

      We have talked about having two tutorials yes.  We aren't planning one for the near future.  There are many more things you can do with Mercurial and with Git than our covered by our tutorial – which is really teaching users about bitbucket and not any particular DVCS.  We often talk about expanding and creating tutorials with more in depth material about Git commands and process — or Mercurial commands and processes . Would you have liked this as well?


  5. Anonymous

    So I can go throught 101 for Mercurial?  I do not want to download, use, learn Git. Just Mercurial.
    Or do I have to go to the Mercurial site?lket


    1. Hi,

      This tutorial is for Bitbucket's features and how to use them. Since Bitbucket supports both Git and Mercurial, the tutorial has you getting a taste of both.  The guide isn't intended to be a tutorial for Mercurial or Git as DVCS packages. If you want to learn the ins and outs of Mercurial, yes, you should use the tutorial the makers of Mercurial recommend.



  6. I've imported a GitHub project into BitBucket. Since then, the GitHub project has received changes. What's the easiest way to import the GitHub changes into the BitBucket version?

    1. The easiest way just depends on how big a change.  One or two files, you could just clone the Bitbucket version and make the change manually.  If you expect to try an maintain these both simultaneously, you should investigate using push hooks or some other automation feature to keep them in sync.

  7. Thanks for the quick response! Yeah, I guess those are standard options for importing changes. I hear talk of BitBucket adding a feature similar to Import, where BitBucket can from the web browser import changes from the original repository. That would be cool!

  8. Anonymous

    Something that would be very helpful in this documentation is a list of terms and definitions (i.e. Repo, Fork, Pull Request, SSH for Git, etc.).  I'd include a brief explanation of what each term means/is and how it's used in relation to other tools and Bitbucket.  This dictionary would be very helpful for developers moving from Microsoft products or even SVN.

    1. Thank you for the suggestion.  I weigh the pros and cons of this a lot; a brief explanation is some times not possible – in particular if I'm comparing and contrasting tools.  So, I'm not sure I want to put that into the tutorial. Glossaries don't typically get a lot of users; but maybe I can pitch another way that would draw more users.

  9. Anonymous

    I have a team account.

    And here is the problem: how to check previous version of my source code after one member of my team has made some changes and merged them?

    thank you!!!

    1. Hi,

      I need more information. By "check" do you mean review the changes, test the changes, or something else? 


      1. Anonymous


        ( updating own repository )

        git pull origin master   

        ( push own locally changes to git repository )

        ( command )  (first commit then push)

        git commit -a -m "add changes"

        git push origin master

        1. The easiest way to do this is for you and your team mates each to work in branches.  That way, you don't pull his code directly into yours.  You can learn some basics workflows here:

          1. Anonymous

            what do you means ? ( That way, you don't pull his code directly into yours.)

            1. When you work on a repository, you are always working on a branch. To see which branch you are on use the git status command.  

              If you pull another user's changes directly into your working branch, git attempts to merge for you. Depending on what you are doing, you might not want to run the risk of clobbering your current work.   

              Git Branching is a great resource on this topic.

  10. Can I create a 'bare' Git repository?  I tried to ssh via command line to bitbucket to do this, but it is not allowed.

    1. You can create an empty repo on Bitbucket and clone it, yes. Did I understand your question?

      1. Thanks for the reply!  Actually, can I ssh into my repo on BitBucket and use the command line there?

      2. Now I realize 'ssh' login is NOT allowed.  I'm trying to create a 'bare' repo of an existing production website.


        Is it correct that by using:

        > git remote add origin ssh://

        this will create a 'bare' repo?


        Thank you!

        1. Guy,

          Correct, you cannot ssh directly to Bitbucket and use a command line.  Also, you can't create a repo on Bitbucket with a git command.  You can do it with a REST call.

  --data "name=mynewrepo"

          See the repository Resource for more information on this.


      3. Anonymous

        There is a difference between a repo and a bare repo. How do you create a bare repro?

        1. Yes, a bare repo doesn't contain a working code tree. A bare repo is contains only the contents of the .git subdirectory.   You can't create one on Bitbucket. You can only create them on your local machine. To create one, you supply the --bare flag when you clone.

          git clone --bare repository_url

          This net resource has more information on them:

  11. Anonymous

    گنج تو وجودت است؛ جای دیگر به دنبالش نگرد! همه قصر ها و همه ی پل هایی که به قصر ختم میشوند مهمل و بی معنی اند، تو باید پل خود را در درون وجود خود خلق کنی! قصر آنجاست؛ گنج هم آنجاست...

  12. Anonymous

    嗯 ,很好!

  13. Anonymous

  14. Anonymous

    In case you haven't noticed already, the link to the Max OSX version of SourceTree incorrectly links to the Windows version.

    1. Nope, I hadn't noticed. Thanks for the catch. (wink)

  15. Anonymous

    Great idea but hopelessly difficult site to use. How can any busy author wish to spend time learning all these technicalities? Please create a user friendly site!!!

    1. Hi, I'm sorry to hear you weren't satisfied with the site. Developing code is a technical task so, while Bitbucket does strive to make things as easy as possible, it would be unlikely we could eliminate the need to learn for everyone.  If you could provide more information about what you found too technical, we might be able to help you further.

  16. Anonymous

    I know the effort this documentation represents.

    You could add "Probably need to install xclip" in the SSH part.

    And a setp-by-step tutorial. No explanations, no theory. Just do it.

    The bad part was that this can be put to work without GitBash. Never find in LinuxMint or in any other tutorial. Let's hope it's automatic or just for Windows.

    Any way, without your work, I could not do it. Thanks.


  17. Anonymous

    Dear sir,

    I have already create the account in the bit bucket and already i have installesd the source tree in our computer..I want to try add the some source code through the source's easily add in the source tree..after that when i want to view the same code through the bit bucket then it's not possible..sir please help me to access the code through bit bucket account..

  18. Anonymous

    Hi guy, thank you for your sharing. I got a problem when i clone a project from bitbucket with following your step. When I use command 'git clone URL', it will have 'connection time-out' error message after a while. So can you help me fix it. thanks.

  19. Anonymous

    Want to try bucket-o-sand

    Login, clone, Copy the https command, run it on local Linux,  but git the error: how to work around?

    git clone
    Initialized empty Git repository in /home/admdtsp1/git/projects/bucket-o-sand/.git/
    error: Couldn't resolve host '' while accessing

    fatal: HTTP request failed



    1. It's hard to tell exactly why our getting the fail message. I'm looking at the command you have listed and wonder if you are missing the user name shown in bold in the following example:

      git clone

      Other wise you can contact support through:

  20. Across the top of each repository is a menu bar (1) that you use to navigate around to your repository's pages. Click items on the bar to see what is behind each one. An actions area (2) where you can clone, branch, create a pull request, and other repository actions. The repository administrator settings (3) to open the admin page. The (4) section contains a get started workflow for a new repository, which is replaced with the activity feed once you get working.

    You can also navigate using the repository shortcuts. To view the shortcuts available:

    1. Click somewhere in the Bitbucket browser window to gain focus.
    2. Press the ? (question mark) on your keyboard.
      The shortcuts list displays.

    Try clicking the Commits option on the menu bar. You find there are No commits recorded yet (during your repository exploration you probably saw this message as well). You have no commits because you have not created any content for your repository. Your repository is private and you have not invited anyone to the repository. So, the only person who can create or edit the repository's content right now is you, the repository owner.--*****

  21. Great tutorial. Git now makes perfect sense!

  22. Last night, I was about to proceed to the "Git with Branches" page, when both that Atlassian site and BitBucket sites stopped responding.  This morning, I keep getting permission errors when I tray to navigate past this page.  There is a note at the bottom of this page that reads: "Error formatting macro: include: com.atlassian.confluence.core.service.NotAuthorizedException: User 'ipad.guy.100' does not have permission to view the page 'BITBUCKET:_Documentation Footer'."

    As first impressions go, this is not very good.