Skip to content

imamrb/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

127 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles ⚡

Setup scripts for mac: /Documents/MacSetup

Prerequisite

# 1. Install oh_my_zsh
   sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# 2. Install zinit
   sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"

Installing on a new machine

  • Clone the repository to ~/.dotfiles folder
  • Ignore the repo to avoid tracking itself
  • Define an alias named dotfiles which will work substitute git command
  • Don't show untracked files in dotfiles status
  • Backup the existing files to .dotfiles-backup folder and replace them with newer ones.
  • Checkout the actual content from your .dotfiles repository to $HOME
   git clone --bare git@github.com:imamrb/dotfiles.git $HOME/.dotfiles

   alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'

   # Backup existing files and checkout dotfiles
   mkdir -p .dotfiles-backup && \
   dotfiles checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
   xargs -I{} mv {} .dotfiles-backup/{}
   dotfiles checkout

For Details Explanation of these commands, checkout this blog here.

Git Setup

GPG key (signing commits)

# Generate a new GPG key (use your name/email, pick RSA 4096)
gpg --full-generate-key

# List keys to get the key ID
gpg --list-secret-keys --keyid-format=long

# Configure git to use it
git config --global user.signingkey <KEY_ID>
git config --global commit.gpgsign true

# Add the public key to GitHub: https://github.com/settings/gpg/keys
gpg --armor --export <KEY_ID> | pbcopy

Per-machine config files

These are not tracked in dotfiles — create them on each machine:

~/.gitconfig-local — machine-specific signing key:

[user]
	signingkey = <KEY_ID>

~/.gitconfig-work — work identity (optional):

[user]
	name = Your Name
	email = you@company.com
	signingkey = <WORK_KEY_ID>

These are picked up automatically by includeIf in the shared .gitconfig:

includeIf pattern Loads Purpose
gitdir:~/ ~/.gitconfig-local Default signing key (per-machine)
gitdir:~/Work/ ~/.gitconfig-work Work identity

Thanks to

About

Dotfiles including zshrc, pryrc, setup scripts etc

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors