# Editing a file in the browser

A file opens in an editor with highlighting and preview; saving is a commit to the selected branch with a commit message.

> **Who can use this:** Requires write access to the repository. For someone else's public repository, fork it and edit the fork.

## Open the editor

On the file page press **Edit**. Next to it are **Rename**, **Delete**, **History**, **Source**
(raw text without rendering) and **Download**.

## The editor

* On the left — the text with highlighting and line numbers, on the right — the rendered preview.
  The switches above the field change the layout: edit only, both, or preview only.
* The bar above the editor shows the state: **no changes**, **not saved**, **saved {time}**. An
  unsaved draft is kept in the browser and restored the next time you open the file.
* At the bottom — the **Commit message** field and the **Save** button. The message becomes the
  commit title; an empty one is replaced with a standard one.

## Where it is saved

Saving makes a commit to the selected branch (the «branch …» label next to the button). To leave the
main branch alone, create your own first — [Branches](https://skillok.org/docs/en/repositories/branches-and-commits/branches) —
edit in it, and then merge through a pull request.

## Rename and delete

**Rename** changes the file name and path (you can move it to another folder by adding `/`).
**Delete** removes the file from the branch with a commit — it does not disappear from history, and
the old version can always be opened through **History**.

---

https://skillok.org/docs/en/repositories/files/editing-a-file
