Is it possible to edit file and commit github/bitbucket from browser
Asked Answered
H

7

7

I want to use editor in browser and save in github without server. Just like text editor in github/bitbucket could new file and save it

I want to know are there any REST api of this 2 services to easily commit file like that

Or a git library in js that could work without the need to pull all files in to our machine

edit:

After 2018 both service already expose their API. This question is outdated

Handal answered 28/4, 2016 at 9:21 Comment(1)
Update Aug. 2021: GH Codespace is now available. See my answer belowDemp
G
5

In case you're looking for an online code editor that you can connect to github or bitbucket then you could take a look at these:

If you're looking to develop such an editor yourself, you could just start from github or bitbucket's REST API documentation:

And just choose the javascript REST library of your preference to interact with those APIs.

For Github: to create/update/remove files you can use the Contents resources.

For example, this section explains how to update a file.

Grandmamma answered 19/5, 2016 at 10:35 Comment(3)
Thanks but actually I was found api of github. Problem is I can't find API for commit a file for bitbucketHandal
@Thaina, you're looking for the Contents resources. I've updated my answer with a few links to the docs.Grandmamma
Sorry, I mistook "bitbucket" for "github" in your first remark. With bitbucket I don't think they've exposed updating files through their REST API, so you won't be able to use that. You could write your own server application that would use a git library to interact with your repositories and exposes the necessary actions through a REST API, but that's not a trivial thing to do ... Or you could implement your own bitbucket (Server) add-on to expose those REST calls, but that's not easy either.Grandmamma
D
4

Bitbucket user here, you can EDIT/COMMIT your files in browser.

https://gyazo.com/ff3cb58bcc1cceda0306037989f32ab1

Dodecasyllable answered 12/5, 2016 at 21:49 Comment(0)
D
2

Bitbucket has an online editor where you can change the file and commit right away. Check it out here.

Damalis answered 19/5, 2016 at 12:13 Comment(0)
T
1

See the official response here:

tldr: They're working on expanding their API and have responded to an issue opened in 2013

EDIT: An endpoint to do this is now available!

Teratism answered 2/6, 2017 at 14:13 Comment(1)
IT'S READY, LET DO IT.Teratism
D
1

Update August 2021: just type . (dot)

🤫 New shortcut: Press . on any GitHub repo.

dot

That will launch GitHub Codespace on your current repository.

Demp answered 11/8, 2021 at 18:31 Comment(0)
D
0

You can install on your local computer benweet/stackedit, a markdown javascript editor.

As mentioned in the README,

Publish your Markdown document on GitHub

(See more at Publication)

https://static.mcmap.net/file/mcmap/ZG-AbGLDKwfwW7bQXRlAZGyic7MlbmMvan-lan3QWRft/benweet/stackedit/master/public/res/img/menu.png

Demp answered 12/5, 2016 at 18:43 Comment(0)
T
-1

You can use Power Editor for Bitbucket for editing and commiting code from browser in bitbucket.

Tartrazine answered 26/6, 2019 at 6:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.