GitHub lets you read repository history, inspect individual commit diffs, view the history of one file, and create a small commit directly in the browser.
Repository commit history
- Open the repository on GitHub.
- Go to Code.
- Above the file list, click the commits link next to the clock icon.
- Find a commit by its message.
The list shows the author, date, message, and short commit identifier.
An individual commit page
Click a commit message. GitHub shows:
- changed files;
- added and removed line counts;
- removed lines in red;
- added lines in green;
- a permanent URL for that commit.
You can share the address-bar URL with a teammate. It points to that exact history entry.
History of one file
- Open a file from Code.
- Click History above the file content.
- GitHub shows commits that changed that file.
- Open any commit and inspect its diff.
File history can be shorter than repository history because unrelated commits are omitted. GitHub may also simplify complex histories. Return to the full Commits page if an expected commit is missing.
Make a small edit on GitHub
- Open the file.
- Click the pencil icon Edit this file.
- Change the text.
- Use Preview for Markdown.
- Click Commit changes….
- Enter a short, meaningful message.
- Choose where to create the commit and confirm.
The commit now exists on GitHub, but GitHub Desktop still needs to receive it.
Pull the web commit into GitHub Desktop
- Open the repository in GitHub Desktop.
- Confirm Changes is empty.
- Click Fetch origin to check GitHub for new commits.
- Click Pull origin to download them and update local files.
- Open History and find the web commit.
- Compare its diff with the browser view.
Safe viewing versus changes
- Opening commits, History, and diffs is read-only.
- Fetch checks remote history without changing working files.
- Pull updates the local branch with discovered commits.
- Edit this file changes content only after Commit changes is confirmed.
Checklist
- I can open the repository Commits page.
- I can read an individual commit diff.
- I can copy a permanent commit URL.
- I can open one file’s History.
- I understand Fetch versus Pull.
- I can find a web commit in GitHub Desktop.
๐ฌ Comments (0)
No comments yet
Be the first to share your opinion about this article!