connorads / dotfiles

@connorads dotfiles 🟢

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dotfiles

Use git (and Sublime Merge) to manage dotfiles without using symlinks. Uses brew to install software and rtx to manage runtimes.

Usage

If you've already got your dotfiles setup you can use the following commands to manage your dotfiles.

Track file

dotfiles add -f .somefile

Untrack file

dotfiles rm --cached .somefile

Update Brewfile

brew bundle dump --force

Setup (from this repo)

If you want to (fork and) clone this repo and use it for your own dotfiles, follow these steps.

  1. Clone repo

    DOTFILES_REPO=https://github.com/connorads/dotfiles/
    DOTFILES_DIR=$HOME/git/dotfiles
    git clone --bare $DOTFILES_REPO $DOTFILES_DIR
  2. Change worktree to home directory

    cd $DOTFILES_DIR
    git config --unset core.bare
    git config core.worktree $HOME
  3. Put dotfiles from git into home directory (⚠️ this will overwrite existing dotfiles in home directory)

    cd $HOME
    git --git-dir=$DOTFILES_DIR/ checkout -f
  4. Setup brew and install packages

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    eval "$(/opt/homebrew/bin/brew shellenv)"
    brew bundle install
  5. You can now reload your shell and open Sublime Merge

    smerge $DOTFILES_DIR

Setup (from scratch)

Follow these steps to recreate the setup for this repo from scratch.

  1. Create repository to store dotfiles

    DOTFILES_DIR=$HOME/git/dotfiles
    git init --bare $DOTFILES_DIR
  2. Change worktree to home directory

    cd $DOTFILES_DIR
    git config --unset core.bare
    git config core.worktree $HOME
  3. Ignore all files except .gitignore (Sublime merge doesn't support status.showUntrackedFiles=no)

    cd $HOME
    echo "/*" >> .gitignore
    echo "!.gitignore" >> .gitignore
  4. Add alias to .zshrc

    echo "alias dotfiles='git --git-dir=$HOME/git/dotfiles/'" >> $HOME/.zshrc
  5. You can now start tracking files

Credit

Inspired by

About

@connorads dotfiles 🟢


Languages

Language:Ruby 73.3%Language:Shell 26.7%