Edit your code in the cloud with Bitbucket

By on May 14, 2013

Have you ever wanted to make a quick change to a file in a repository without having to clone it locally? You want to edit your code where it lives. Introducing the Bitbucket online editor: edit your code directly with Bitbucket – no command line, no cloning, no local editor.


Edit any file, anywhere

From Bitbucket, you can edit any file, anywhere, all you need is your browser. Once you’re happy with your edits, you can commit straight away or create a pull request to contribute your changes.

Edit button from Source

Once you select Edit from the source browser, Bitbucket activates the editor and away you go. Syntax highlighting and diff view are all an integrated part of the code editing experience.

Bitbucket editor

The editor is intelligent enough to determine the indentation style from the file’s original contents. If it’s off the mark, you can manually set your preferred indent mode and tab size.


The workflow is flexible for every team’s process – commit directly to the branch you’re editing on, or create a pull request and select your reviewers. If you don’t have write access, Bitbucket will automatically create a fork for you and commit your changes before submitting a pull request.

Quickly react to pull request feedback

Editor from pull requests

If your team is like ours, you’re using pull requests for code review. Often times, you have changes you need to make based on feedback from your teammates before your code is merged. Editing online shouldn’t get in your way. The Bitbucket online editor allows you to edit your open pull requests directly. We’ll even update your pull request for you once you’ve committed your changes.

Built with CodeMirror

At the core of the Bitbucket online editor is CodeMirror – an excellent open-source JavaScript code editor component. The project’s terrific extension API as well as its top-notch documentation made implementation nearly painless. In addition, the friendly MIT license, the editor’s blazing-fast performance, and the project’s support for a wide number of languages made the choice of CodeMirror an easy one.


  • Posted May 14, 2013 at 12:54 pm | Permalink

    It would be great to have the ability to select vim or emacs key bindings since CodeMirror already supports both.

    • Jon Mooring
      Posted May 14, 2013 at 1:03 pm | Permalink

      Yep, definitely something we’ve considered. We have an open issue in our backlog. Thanks for the suggestion!

  • Matthew Turk
    Posted May 14, 2013 at 1:16 pm | Permalink

    This is really awesome! Thanks for adding this. One quick question — with hg it looks like this uses named branches by default. Any chance of that getting changed to something less permanent / namespacey, like bookmarks or anonymous heads? Thank you!

    • Jon Mooring
      Posted May 14, 2013 at 1:27 pm | Permalink

      Not something we considered, but definitely a good idea. I’ll add a ticket to our internal issue tracker. Thanks for the suggestion!

      • Matthew Turk
        Posted May 14, 2013 at 1:35 pm | Permalink

        Thanks, Jon! We’ll probably start using this right away in our project for quick fixes that don’t need pull requests — it’s a really awesome feature to have. If there’s a place I can “watch” the issue about potentially having anonymous heads / bookmarks, I’d love to hear about updates so we can roll this out for code reviewable changes.

  • Posted May 14, 2013 at 1:46 pm | Permalink

    Now only one issue needing a fix before I’m super happy: https://bitbucket.org/site/master/issue/2184.

    • Kenneth Endfinger
      Posted May 18, 2013 at 11:06 pm | Permalink

      +1 for a fix for that. Been wanting that so much!

  • Posted May 14, 2013 at 4:30 pm | Permalink


  • Posted May 14, 2013 at 7:59 pm | Permalink

    God says…
    visit those that be cut off, neither shall seek the young one, nor
    heal that that is broken, nor feed that that standeth still: but he
    shall eat the flesh of the fat, and tear their claws in pieces.
    11:17 Woe to the idol shepherd that leaveth the flock! the sword shall
    be upon his arm, and upon his right eye: his arm shall be clean dried
    up, and his right eye shall be utterly darkened.

  • Posted May 14, 2013 at 8:38 pm | Permalink

    +1 for vim bindings

  • Anonymous
    Posted May 14, 2013 at 10:30 pm | Permalink

    need a vi like editor, vian or jsvi are ok

    and i guess the next step is to let user developing online or deploy it online?

  • Posted May 15, 2013 at 8:49 am | Permalink

    great feature…

  • xr09
    Posted May 15, 2013 at 9:32 am | Permalink

    +1 vim keybindings

  • Anonymous
    Posted May 15, 2013 at 10:34 am | Permalink

    Are you going to add the ability to create a file on the fly?

    • Posted May 17, 2013 at 10:33 am | Permalink

      In a future iteration we’ll add this.

      • Anonymous
        Posted May 17, 2013 at 11:18 am | Permalink


      • Alex
        Posted May 27, 2013 at 2:05 am | Permalink

        Cool, thanks 🙂

  • Posted May 15, 2013 at 1:58 pm | Permalink


  • pavan bangaram
    Posted May 16, 2013 at 2:47 am | Permalink

    This is really awesome! Thanks for adding this post. Great post..!

  • James Zhang
    Posted May 16, 2013 at 8:18 am | Permalink

    Add the ability to create a file in folder on the fly please!!!

  • Kuitsi
    Posted May 16, 2013 at 8:32 am | Permalink

    Commits are not visible in Dashboard and repository’s Recent Activity.

    • Posted May 16, 2013 at 10:26 am | Permalink

      Nice catch there, if you are referring to commits done via the online editor.

    • Jonathan Mooring
      Posted May 17, 2013 at 10:51 am | Permalink

      We had some weirdness with our post-commit background tasks yesterday. Are you still seeing this?

      Another thing to note is that if you choose to create a pull request for your change, we’ll collapse the commit activity with the pull request creation activity.

  • Paul Chen
    Posted May 17, 2013 at 1:49 am | Permalink


  • Diego Alonso
    Posted May 17, 2013 at 4:05 am | Permalink

    Ability to share an editing session for remote pair programming would be awesome!

  • Dan Brown
    Posted May 18, 2013 at 1:56 pm | Permalink

    This is awesome, Now I can edit code on my chrome book and then pull it down later into android studio. Thank you very much!!!

    • Kenneth Endfinger
      Posted May 18, 2013 at 11:05 pm | Permalink

      Cool, a Chromebook user 🙂 dev-mode on?

  • Tamás Herman
    Posted May 18, 2013 at 10:49 pm | Permalink

    Include collaborative editing, like http://coderpad.io/ then you will be the ultimate web app prototyping platform pretty quick

    I wish http://darcs.net/ would have such a nice hosting service as BitBucket…

  • Anonymous
    Posted May 20, 2013 at 6:38 am | Permalink

    Finally! Thank you SO much.

  • Posted May 22, 2013 at 6:14 am | Permalink

    This is really useful!

  • Posted May 24, 2013 at 8:24 am | Permalink

    BitBucket, you guys are very much awesome. This is a very nice addition and very well implemented. I love your service so much, I am always looking for more projects to code, so I can push them to your repos… seriously.

  • Posted May 27, 2013 at 3:45 am | Permalink

    This is really cool! I love the feature.

  • Posted May 28, 2013 at 10:16 am | Permalink


  • David
    Posted May 29, 2013 at 8:52 pm | Permalink

    It would be great to hav..

  • Javier Tapia
    Posted May 30, 2013 at 8:10 am | Permalink

    Fine! A long awaited feature.

  • Posted May 31, 2013 at 2:10 pm | Permalink

    Awesome feature.

  • Mark7614
    Posted June 1, 2013 at 3:18 pm | Permalink

    Great idea, but doesn’t seem to work with iPad. No keyboard appears when I position the cursor for editing.

  • Vishant
    Posted June 3, 2013 at 2:28 am | Permalink

    Does it support ruby on rail code edits

  • Thomas Thomassen
    Posted June 4, 2013 at 9:11 am | Permalink

    This feature is great. I just used it on a pull request I had to make some minor tweaks in order to make the code conform with the project coding style. Incredible easy to just do that directly in the Pull Request instead of manually pulling etc.

  • Anonymous
    Posted June 4, 2013 at 9:24 pm | Permalink

    Nice … for that moment when you are somewhere in the wild and suddenly the solutions strike your head. Cool

  • frif
    Posted June 6, 2013 at 2:30 am | Permalink

    It would be nice to be able to test that the code works before committing the edits. Something like having the changes available as a Dropbox share would allow me to do that, by having that share mounted on my development server I could test the changes.

  • kulak
    Posted June 10, 2013 at 8:02 am | Permalink

    It would be great if it will be possible to create a new file and edit it from Bitbucket 🙂

  • stringerbell
    Posted June 12, 2013 at 7:42 am | Permalink

    Super cool! It seems like editing code directly and saving on bitbucket doesn’t trigger a POST request like it does when pushing to it. Any chance of adding this?

  • Anonymous
    Posted June 12, 2013 at 10:21 am | Permalink

    This is better than slice bread! yay

  • Hayk Saakian
    Posted June 12, 2013 at 10:47 am | Permalink

    What about opening up the api for this? Maybe I want to make automatic small changes llike updating rails if there’s a new vulnerability found.

  • pm
    Posted June 12, 2013 at 3:00 pm | Permalink

    Awesome and very useful, thanks !

  • CodeMirrorer
    Posted June 12, 2013 at 4:12 pm | Permalink

    My team ♥’s CodeMirror! You can download the code or fork it on GitHub via https://github.com/marijnh/CodeMirror.

  • weager
    Posted June 13, 2013 at 9:27 am | Permalink

    That‘s great.

  • richard
    Posted July 23, 2013 at 8:58 pm | Permalink
  • Tricae
    Posted September 2, 2013 at 1:47 pm | Permalink

    If one could search for code online, we could fix it also.
    So no we make a local clone, search for code in our IDE and then change the code online :))

  • Preetham
    Posted September 21, 2013 at 12:17 pm | Permalink

    I always get this error message when I try to commit using ur online editor. I have tried a lot of times. “We had trouble committing your changes.”

  • Krunkadunk
    Posted October 11, 2013 at 11:31 pm | Permalink

    “no command line, no cloning, no local editor” “all you need is your browser” – okay! I signed up, created a repo in Bitbucket, and now it tells me to create a local git repo and make a commit. Um… with no command line… because all I need is my browser, right? I had to create an empty repo on github and import it to get started, and now it appears that I can’t add a file online. So… I can edit in the cloud, but I can’t create? Pathetic!

  • diegotsu
    Posted September 22, 2014 at 11:43 am | Permalink

    Is it possible to edit more than 1 file and put it together into one single commit?

2 Trackbacks

  • […] 最近では、プロジェクトの修正もフォークの作成同様、簡単になりました。フォークを作成する際に作業するプロジェクトの完全な遠隔コピーをあっという間に作れるように、変更したいファイルを選択し、編集するを押して修正をコミットする事で、プロジェクト修正が行えます。 […]

  • By Gazing into the CodeMirror | TRIFORCE STUDIO on January 4, 2016 at 12:34 am

    […] rather than in a browser window). You’ll also find CodeMirror working behind the scenes at Bitbucket, JSFiddle, Paper.js, and close to 150 other […]