mirror of
https://codeberg.org/forgejo/docs.git
synced 2024-11-28 18:42:51 -05:00
user: blame: adapt to Forgejo (#146)
Caution: it needs to be squashed before merge to be backported. It is kept as two commits to preserve the original version. Reviewed-on: https://codeberg.org/forgejo/docs/pulls/146 Reviewed-by: Loïc Dachary <dachary@noreply.codeberg.org> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
b77359bfb1
commit
43a07a1cba
3 changed files with 28 additions and 0 deletions
BIN
docs/_images/user/blame/view.png
Normal file
BIN
docs/_images/user/blame/view.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 91 KiB |
27
docs/user/blame.md
Normal file
27
docs/user/blame.md
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
---
|
||||||
|
title: 'Blame File View'
|
||||||
|
license: 'Apache-2.0'
|
||||||
|
origin_url: 'https://github.com/go-gitea/gitea/blob/8d9e2d07f3f84a86265fdbe0ab7fcf63cc34ddbd/docs/content/usage/blame.en-us.md'
|
||||||
|
---
|
||||||
|
|
||||||
|
Forgejo supports viewing the line-by-line revision history for a file also known as blame view.
|
||||||
|
You can also use [`git blame`](https://git-scm.com/docs/git-blame) on the command line to view the revision history of lines within a file.
|
||||||
|
|
||||||
|
![Blame view of a file](../_images/user/blame/view.png)
|
||||||
|
|
||||||
|
1. Navigate to and open the file whose line history you want to view.
|
||||||
|
1. Click the `Blame` button in the file header bar.
|
||||||
|
1. The new view shows the line-by-line revision history for a file with author and commit information on the left side.
|
||||||
|
1. To navigate to an older commit, click the icon.
|
||||||
|
|
||||||
|
## Ignore commits in the blame view
|
||||||
|
|
||||||
|
All revisions specified in the `.git-blame-ignore-revs` file are hidden from the blame view.
|
||||||
|
This is especially useful to hide reformatting changes and keep the benefits of `git blame`.
|
||||||
|
Lines that were changed or added by an ignored commit will be blamed on the previous commit that changed that line or nearby lines.
|
||||||
|
The `.git-blame-ignore-revs` file must be located in the root directory of the repository.
|
||||||
|
For more information like the file format, see [the `git blame --ignore-revs-file` documentation](https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt).
|
||||||
|
|
||||||
|
### Bypassing `.git-blame-ignore-revs` in the blame view
|
||||||
|
|
||||||
|
If the blame view for a file shows a message about ignored revisions, you can see the normal blame view by appending the url parameter `?bypass-blame-ignore=true`.
|
|
@ -27,6 +27,7 @@ involved in running it on their machines.
|
||||||
- [Clone & Commit via Web](https://docs.codeberg.org/git/clone-commit-via-web/)
|
- [Clone & Commit via Web](https://docs.codeberg.org/git/clone-commit-via-web/)
|
||||||
- [Tags and Releases](https://docs.codeberg.org/git/using-tags/)
|
- [Tags and Releases](https://docs.codeberg.org/git/using-tags/)
|
||||||
- [Branch and tag protection](./protection/)
|
- [Branch and tag protection](./protection/)
|
||||||
|
- [Git blame](./blame/)
|
||||||
- Advanced Usage
|
- Advanced Usage
|
||||||
- [Issue and Pull Request Templates](./issue-pull-request-templates/)
|
- [Issue and Pull Request Templates](./issue-pull-request-templates/)
|
||||||
- [Actions](./actions/)
|
- [Actions](./actions/)
|
||||||
|
|
Loading…
Reference in a new issue