Code Monkey home page Code Monkey logo

dotfiles's Introduction

Chad's Linux Config files

This is my collection of dotfiles for zsh, vim, and iTerm2. The general concept I follow is a pretty common one– using a bare git repo (stored in ~/.dotconf) with the work tree pointed at my home directory. I find this pretty easy to use- no special tools/scripts (just an alias), no symlinks to manage, version control, and easy replication. You can also edit any dot file directly on whatever box you may be using and can easily merge it back into this repo using standard git commands if desired.

The Initial Repo Build

Here are the commands I used to create this repo:

# create the initial repo locally
git init --bare ${HOME}/.dotconf

# set up an alias for ease of use
alias dotconf='/usr/bin/git --git-dir=${HOME}/.dotconf/ --work-tree=${HOME}'

# make sure it doesn't freak out abou everything else in my home directory
dotconf config status.showUntrackedFiles no

# make sure git doesn't suck up its own directory
echo ".dotconf" >> .gitignore
echo "README.md" >> .gitignore
echo "LICENSE" >> .gitignore

Then, for each dot file:

dotconf add <filename>

And then to push it up to Github:

# commit
dotconf commit -m "Initial setup from existing files"

# configure the origin
dotconf remote add origin [email protected]:lackhead/dotfiles

# push
dotconf push -u origin main

Note that I do have the dotconf alias in my .zshenv file- this is just to make standard git things easy (e.g. dotconf status).

To Get Dotfiles on a New Machine

NOTE: There is a script in my userconfig repo that does this for you.

If you want to get started using this on a new machine somewhere, the general ideas is to clone the repo, copy the files into place, remove the working directory (the ~/.dotconf directory, which git uses, remains), and tailor the repo to only care about the dot files in the repo (ignoring everything else in my home directory as well as the README.md/LICENSE file in the repo):

git clone --separate-git-dir=${HOME}/.dotconf [email protected]:lackhead/dotfiles ${HOME}/dotfiles_temp
rsync --archive --verbose --exclude '.git' --exclude README.md --exclude LICENSE dotfiles_temp/ ${HOME}/
rm -rf ${HOME}/dotfiles_temp
alias dotconf='/usr/bin/git --git-dir=${HOME}/.dotconf/ --work-tree=${HOME}'
dotconf config status.showUntrackedFiles no
dotconf update-index --assume-unchanged README.md LICENSE

General Usage

Go ahead and update dotfiles as you see fit on whatever box you happen to be working on and use standard git techniques to manage the canonical copies in the repo. If you want to add more files, just use dotconf to do the add/commit/push as per normal.

dotfiles's People

Contributors

lackhead avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.