Skip to content

Git Setup⚓︎

Install git and github cli⚓︎

sudo pacman -S git
sudo pacman -S github-cli

Restart terminal after installation

Login to github and config git⚓︎

gh auth login
gh auth setup-git

Setup vscode as default editor for git⚓︎

git config --global core.editor "code --wait"

Git config⚓︎

git config --global --edit

Paste at the end (replace signing key with github ssh signing public key path)

Also sets default branch to main

[user]
 name = <username>
 email = <email>
 signingkey = <public_signing_key_path>
[gpg]
 format = ssh
[commit]
 gpgSign = true
[init]
 defaultBranch = main

Enable openssh authentication agent⚓︎

Install keychain if not installed already

sudo pacman -S keychain

Add ssh signing private key to ssh-agent⚓︎

Add keychain to fish shell configuration to load keys on shell start. (Lookup alternative setup for your shell)

mkdir -p ~/.config/fish/conf.d && micro ~/.config/fish/conf.d/keychain.fish

Copy-paste this configuration in keychain.fish

if status is-interactive
    # To add a key, set -Ua SSH_KEYS_TO_AUTOLOAD keypath
    # To remove a key, set -U --erase SSH_KEYS_TO_AUTOLOAD[index_of_key]
    keychain --eval $SSH_KEYS_TO_AUTOLOAD | source
end

Now, you can add your github keys to the SSH_KEYS_TO_AUTOLOAD environment variable.

set -Ua SSH_KEYS_TO_AUTOLOAD keypath

Install git-chglog⚓︎

Git changelog generator (generate changelog from git commits)

paru git-chglog

git-chglog --init in a git repository to generate a config file

Install git-crypt⚓︎

Encrypt files in git

paru git-crypt