Skip to content

Latest commit

 

History

History
89 lines (63 loc) · 2.02 KB

README.md

File metadata and controls

89 lines (63 loc) · 2.02 KB

GitBash with zsh

Goals of this setup

  • Working on Windows 10, on Windows filesystem
  • Having a visually nice terminal (Windows Terminal)
  • zsh as my main shell

Install GitBash

Setup git

#!/bin/bash

# Set username and email for next commands
email="[email protected]"
username="Alex-D"
gpgkeyid="8FA78E6580B1222A"

# Configure Git
git config --global user.email "${email}"
git config --global user.name "${username}"
git config --global user.signingkey "${gpgkeyid}"
git config --global commit.gpgsign true
git config --global gpg.program "$HOME/dev/dotfiles/git-bash/.gpg-pinentry-loopback"
git config --global core.pager /usr/bin/less
git config --global core.excludesfile ~/.gitignore

# Use ssh key from WSL2
git config --global core.sshCommand "ssh -i //wsl$/Ubuntu/home/ademode/.ssh/id_rsa"

Setup zsh

#!/bin/bash

pacman -S zsh

# Launch zsh
zsh

# Clone the dotfiles repository
mkdir -p ~/dev/dotfiles
git clone [email protected]:Alex-D/dotfiles.git ~/dev/dotfiles

# Link custom dotfiles
ln -sf ~/dev/dotfiles/.aliases.zsh ~/.aliases.zsh
ln -sf ~/dev/dotfiles/.p10k.zsh ~/.p10k.zsh
ln -sf ~/dev/dotfiles/.zshrc ~/.zshrc
ln -sf ~/dev/dotfiles/.gitignore ~/.gitignore
ln -sf ~/dev/dotfiles/git-bash/.zsh_plugins.zsh ~/.zsh_plugins.zsh

# GPG Agent
mkdir ~/.gnupg
ln -sf ~/dev/dotfiles/git-bash/gpg-agent.conf ~/.gnupg/gpg-agent.conf
gpg-connect-agent reloadagent /bye

# Git autocompletion
mkdir -p ~/.zsh
cd ~/.zsh
curl -o git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
curl -o _git https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh

GPG key

Import all GPG keys from WSL 2

wsl.exe gpg -a --export-secret-keys | gpg --import --pinentry-mode loopback