Useful tips when navigating through your repository.
Thanks for the duplicate note 👋
An important part of version control is the ability to look into the past. By using git blame
, and finding the story behind a commit, we're able to do more than blame people for code. We're able to see the story around why a commit was made. What is the associated pull request? Who approved the pull request? What tests were run on that commit before it was merged?
The obvious reason to find things in history is to know about the history. With issues and pull requests, we see a more complete story about the history, not just the bare minimum.
git blame
is a Git functionality that shows what revision and author last modified each line of a file. Information like who made a commit, when, and even why can be found this way. If you aren't sure who introduced certain changes to a file, you can use git blame
to find out. While git blame
sounds rather accusatory, this can be used to understand the context around decisions.
A SHA is a reference to a specific object. In this case, it's a reference to a commit. On GitHub, you can look at a specific commit to see the changes introduced, by whom, and if they were a part of a pull request.
- Navigate to the Code tab of your repository
- Tip: you may have previously created your repository in a new tab
- Click
docs
to navigate into the/docs
directory - Click
_sidebar.md
to view the file - On the top of the file, click Blame to see the details of the most recent revision
- Click the commit message,
add sidebar to documentation
to see the commit details - Copy the first seven characters of the SHA (the first 7 characters of the 40 character hexadecimal string listed after
commit
) - Comment on issue #2 by adding the SHA from step 6 as a comment text and click on "Comment" button
- Wait about 20 seconds then refresh this page (the one you're following instructions from). GitHub Actions will automatically update to the next step.
Get help: Post in our discussion board • Review the GitHub status page
© 2023 GitHub • Code of Conduct • MIT License