Setup
Git setup
Depending on your operative system and environment you might have to install git
.
These are nice guidelines from the Github team.
GitHub setup
Two-factor authentication
Users accessing our repositories need to have two-factor authentication enabled.
Please head to https://github.com/settings/security and set it up: you can choose between receiving a SMS and using an authenticator app.
Remotes
Having two-factor authentication enabled, when you clone a repository you need to use the git@
protocol, not https://
:
You will also need to create a SSH Key for the machines you will be working with.
Here's a very nice tutorial from the Github team.
If you have repositories on your local machine that were cloned before changing to 2FA, you will need to change the remote to use the git@
protocol:
git remote set-url origin git@github.com:nestauk/<repo name>.git
Alternatively, you might also authenticate through GitHub CLI via the web browser. In that case, you can work with all repositories on GitHub over HTTPS as well (instead of the git@
protocol).
Setting dev
as the default branch
Since we use this workflow, when we create a new repository we might want to setup dev
as the default branch on our repositories.
This way by merging commits with messages containing Closes #5
or Fixes #5
in dev
will automatically close issues.
This also sets up the base branch for new PRs to dev
so it prevents us to automatically create PRs against main
, that could led to accidentally merge development code in production.