Initial Setup¶
For the configuration please use the Git Bash if you have not setup your PATH yet.
Git Setup¶
Set identity¶
For Usage with GitHub it is essential to have the same email as your GitHub profile.
Set default branch to main¶
Since Git 3.0 main is the default branch instead of the previous master.
Recommended¶
SSH Authentication (GitHub)¶
Do not use HTTPS + passwords. Use SSH.
Generate SSH Key¶
Activate for your OS¶
Accept default path:
Start agent:
Add SSH Key to GitHub¶
Copy public key¶
On GitHub:
- Go to Settings
- SSH and GPG Keys
- New SSH key
- Paste Key
Test Connection¶
Expected:
SSH Signing (GitHub)¶
On our Repos commit signing, so you have to enable it. This ensures commits are cryptographically verifiied on GitHub.
Enable SSH Signing in Git¶
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true
Add Signing Key to GitHub¶
In GitHub:
- Settings
- SSH and GPG Keys
- New SSH Key
- Select Signing Key
- Paste the same public Key
Test Signed Commit¶
In a tmp directory initialize a git repo.
Then create a test commit.
Check:
Expected output should be: