--- title: GitHub URL Schemes for Viewing, Editing, and Commit History created: 2025-07-16 modified: 2026-05-10 sources: - https://docs.github.com/en/repositories/working-with-files/using-files/getting-permanent-links-to-files --- Today I learned that GitHub provides several URL schemes for different file operations. 1. For **viewing files**, use: [^1] ```text https://github.com/{owner}/{repo}/blob/{branch}/{file_path} ``` Example: 2. To **view raw content**, use: ```text https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{file_path} ``` Example: 3. When you need to **modify content**, use: ```text https://github.com/{owner}/{repo}/edit/{branch}/{file_path} ``` Example: > [!TIP] Both view and edit URLs support `#Lx` suffix for jumping to specific lines. Edit URLs require login to save changes, while view URLs are public. The key difference is that edit URLs are for proposing changes and editing content, while view URLs are for sharing lines and viewing raw files. 4. Finally, to explore **version history**, use: ```text https://github.com/{owner}/{repo}/commits/{branch}/{file_path} ``` Example: [^1]: With Markdown files (`.md`), GitHub automatically adds the `plain=1` query parameter when you go to **Code** view to get a line permalink, because Markdown files are rendered without line numbers in **Preview** mode. For code files (`.js`, `.py`, `.txt`, etc.), you get syntax highlighting without the `plain=1` parameter.