Add "view file before commit/PR"
See original GitHub issueWhen viewing a commit page, GitHub provides a link to view each file. The link points to the file at the current commit. Example.
However, sometimes we want to view the version of a file before the commit was made.
For the longest time I have been doing this manually, by clicking “view file” and then editing the URL to add a ^
at the end of the commit (to reference the parent commit).
It would be very useful if this was added as a link in the menu, so we don’t have to resort to hacking the URL like this.
This would also be useful in PRs, where GitHub similarly shows a “view file” link for each file in the diff. Sometimes we want to view the version of a file before all of the commits in this PR.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Add "view file before commit/PR" · Issue #1826 · isaacs/github
For the longest time I have been doing this manually, by clicking "view file" and then editing the URL to add a ^...
Read more >How to see changes to a file before commit? - Stack Overflow
You can stage changes manually with git add , or if the files are already versioned, you can use git commit -a -v...
Read more >Making additional edits on a file after opening a PR
Steps: Viewing your PR in Github, click the “Files Changed” tab. Click the three dots in the top right corner of the editor...
Read more >Add, edit, and commit to source files | Bitbucket Cloud
Edit files online · From the repository, click Source in the left navigation. · Click the file you want to open. · Click...
Read more >How to Open a Pull Request - Gatsby
Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is possible:
Made by:
.dropdown-item
link into.d-flex
width: min-content; padding-left: 8px
This should be applied to regular commits as well.
If a file is deleted by the current commit, the “View file” already points to the old commit, so in that case perhaps we should add the icon inside the existing link; this would indicate that the link points to the old commit.
On the base branch/commit I think? (The existing “view file” points to the head branch/commit.)