Is it possible to edit file and commit github/bitbucket from browser - github

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

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:
Codeanywhere
Cloud9
If you're looking to develop such an editor yourself, you could just start from github or bitbucket's REST API documentation:
Github
Bitbucket
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.

Bitbucket user here, you can EDIT/COMMIT your files in browser.
https://gyazo.com/ff3cb58bcc1cceda0306037989f32ab1

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

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!

Update August 2021: just type . (dot)
🤫 New shortcut: Press . on any GitHub repo.
That will launch GitHub Codespace on your current repository.

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)

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

Related

Do you have to use Github desktop to push files to Github.com?

I am new to web development and it seems like an extra step to have to use a text editor, then transfer files to Github desktop, then to GitHub. Is there a more efficient way to push your content to Github. Also, I am new to stack overflow and I'm excited to be here.
Thank you.
No, you don't have to use Github Desktop. Github is just a service that hosts Git repositories. Git is a version control system and there are zillions of tutorials out on the web that can help get you going learning how to use it.

How to open your own github repo from github.dev

In the new product of Microsoft, github.dev, you are automatically forwarded to a VSCode web IDE. However, I am not sure if it is possible to open your own repo (hosted on github.com), work on it and push the changes. Can you help explain if this can be done and how?
I do not seem to find a straightforward tutorial on that.
Note that I was able to open a repo of mine by clicking on the blue GitHub icon in the bottom left corner, but I fail to install a terminal, because
Terminals are not available for web editor. To use terminal you need to continue working in an environment that can run code, like codespaces or local VS Code
I read that codespaces are a paid option for github enterprise, but the way this error message is written might suggest other ways.
Opening your repository
You can open your repository by visiting it's page on GitHub and pressing . to open it in github.dev. You can also use the url format https://github.dev/<username>/<repo-name> with the path to your repository.
Making Commits
While the terminal cannot be used in the editor, you can make commits using the VSCode source control system.

View GitHub PR comments locally in PhpStorm

I generate a pull request in the company repo on GitHub. My colleagues login to GitHub, review my changes and add comments.
Is there a way from me to pull those comments (or that PR) from GitHub so I can read and, ideally respond to their comments locally from within the latest PhpStorm (version 2017.3.4) or for that matter, from the CLI?
I can see how to generate PRs in PhpStorm and push them up to GH, but not the other way around.
You might try this plugin: https://plugins.jetbrains.com/plugin/10448-github-code-reviews-plugin. In general, this is not yet supported in PhpStorm out of the box, you can vote for that feature request at https://youtrack.jetbrains.com/issue/IDEA-85079 and try out some of the suggestion listed there (e.g. the plugin mentioned above).
I'm not sure if there's something for Github, but for Bitbucket you can use this plugin.

Is it possible to create github repository for my project in Visual Studio Code?

Is it possible to create github repository for my project in Visual Studio Code,
and commit all the files?
I have not found a single example where a repository is created from VSCode.
Now, there is also a "Publish to Github" button in the "Source Control" part, when there is no git repository, to directly create a repository on github.
If you click on it, by default, VSCode propose (in the main bar) to create a private or a public repository with the project's folder name.
Just make a new file in VS Code. Local file created in VSCode
Go to Source Control. You will have an option to Initialize Repository, which inturn creates a repo in Github.
Note : You need to connect to your github account before hand.
There is documentation on this page on how to initialize a repository in vsCode: https://code.visualstudio.com/docs/editor/versioncontrol
EDIT:
Another link that should be helpful: https://code.visualstudio.com/docs/introvideos/versioncontrol
Use GitHub API to create repo. Outside of the API, there's no way to create a repo on GitHub via the command line.
curl -u 'username' https://api.github.com/user/repos -d '{"name":"projectname","description":"project desc"}'
git remote add origin git#github.com:nyeates/projectname.git
As far as I can tell, it's currently not possible with a default installation of VS Code. But you can make it work like this:
Add the REST API client by Huachao Mao to VS Code (others may work, haven't tested).
Create a personal access token in GitHub.
Create a new temporary file and enter the following text:
curl -u 'myGitHubUsername:myToken' "https://api.github.com/user/repos" -d '{"name":"MyNewRepo","description":"Repo Description"}'
Then select the line, press F1, look for "REST" in the search field and run the command "Rest Client: Send request"
After a short while you should be able to add the new remote repo using onboard tools.
Obviously, this is too elaborate for a one-time use. But once it's all set up, it's quite easy to create new repos or interact with the GitHub API in other ways.

Can I display an Ipython notebook hosted on bitbucket?

I have a very simple notebook, hosted on github and on bitbucket.
The github URL
displays fine in the nbviewer, but the bitbucket URL
- which should indicate the same trivial notebook - does not work with the nbviewer.
Is it possible that nbviewer only takes github notebooks?
Later comment:
my repo was private - so that was at least one reason why it could not work!
Since this is/was the first result when googling for this, I just thought I'd update and let everyone know that this is now an add-on available in Bitbucket. You can find it under Settings -> Find Integrations. The source and issue tracker are available here - https://bitbucket.org/bitbucket/bitbucket-nbviewer
Based on this issue on Bitbucket's issue tracker, it does not seem to be supported yet.
As pointed out by #ThomasK in the comments, you can display a notebook from bitbucket if you copy the raw address.
Just click on the three dots next to your notebook and copy the address that you get when you click on Open raw.
Copy this address...
... and paste it in the text box in https://nbviewer.jupyter.org/ ...
... and it will render your notebook: