GitHubλ︎
An online service for sharing Git repositories for open source projects and commercial work.
A GitHub account provides an unlimited amount of public repositories.
Accountsλ︎
User account
Organisation
SSH accessλ︎
Set up a public private key on each computer to be used as a GitHub client, to push commits over an SSH connection.
Check SSH Key on GitHubλ︎
The GitHub keys page for an account lists all the authorisation and signing keys registered.
Each key shows its unique SHA, rather than the key value, for security reasons.
To identify if an SSH key is registered with GitHub, use the ssh-keygen command to show the SHA for public key file, *.pub.
Copy the SHA value generated by the ssh-keygen command and search for that value on the GitHub keys page.
Notificationsλ︎
Ensure notifications are sent to the correct email address for each repository, especially when working for a commercial company with their own repository.
Login to GitHub with your personal account and in Settings > Notifications.
At the bottom of the Notifications page is the Custom routing. Edit the entry for the respective company Org.
GitHub tipsλ︎
Collapsible section in readme, issue or pull request
Status badgesλ︎
Add a quick visual indicator of the state of a repository by adding a GitHub Actions status badge
Automatically assigning reviewers to pull requestsλ︎
Add a CODEOWNERS file in .github directory of a repository to define members of the team that are automatically added as reviewers to a PR
For example, add core team members to all changes made in the repository. Commit this to the base branch (ie. main or live) of the repository
# Codeowners
# Define automatic PR assignment rules
# automatically added as a reviewer to all pull requests (except drafts)
# <https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners>
# Default owners for everything in the repository
* @practicalli-johnny
Pull Request templatesλ︎
A pull request template is a simple way to define expectations as to a constructive pull request contribution. The template is a markdown file called pull_request_template.md placed in the .github directory in the root of the project
Example: statsbomb-live/.github/pull_request_template.md
Emacs & Magitλ︎
magit-status (SPC g s) opens the Magit Git Status buffer
b opens the branch menu
l creates a local tracking branch with the unqualified name of the remote branch (use c instead if you wish to change the name of the local branch)
e.g. if the remote branch is called statsbomb/branch-name then the local tracking branch is called branch-name
Linking issues, PRs and commits to Jira ticketsλ︎
Add an autolinking reference to a GitHub repository to enable Jira ticket references to automatically convert to a link to the ticket. Using a ticket reference such as LD-215 in an issue, pull request or commit message will automatically convert into a link to the Jira ticket
Example - statsbomb-live repository
Settings > Autolink references > Add autolink reference
Reference prefix: LD-
Target URL: https://statsbomb.atlassian.net/browse/LD-
