Dotfiles (like ~/.vimrc, ~/.bashrc, etc. in your home directory) manage the configurations, themes, and settings that you customize within your command line environment. Storing them in a GitHub repository ensures all your favorite configurations are safe and sound in a central place. If you ever want to revert back to a previous configuration, your hard drive gets damaged, or you want to replicate and sync your environment on another machine, you can do so with just a few simple steps.
- bash_aliases
- bash_profile
- bashrc
- vimrc
- gitconfig
- Spell check in vim (no more commit message typos!)
- Minimal bash prompt
- Function
killportfor managing port processes. See my blog post for more details on this. - Alias
gmlprints a pretty one-line format ofgit logfiltered to only my commits
$ gml
* f074c20 2021-07-07 | Update `README` image links (HEAD -> main, origin/main) [Matt Heindel]
* 2d32e40 2021-07-05 | Add alias functions for managing server ports [Matt Heindel]
* ac0df26 2021-07-04 | Add welcome message that displays suggested files on opening bash [Matt Heindel]
* f728b13 2021-07-04 | New alias `cl` combines `cd` and `ls` commands [Matt Heindel]
* 9462a79 2021-07-04 | Modify alias `l` to sort files by most recent modification [Matt Heindel]If you'd like to track your dotfiles, check out this helpful blog post for a full guide.
When adding the configuration files here to a new machine, enter the following commands into bash.
cd ~
git clone https://github.com/matt-heindel/dotfiles.git
cd ~/dotfiles
chmod +x makesymlinks.sh
./makesymlinks.shAny time you change a tracked dotfile, make sure to:
git pushfrom the machine with updatesgit pullto any other machines you work on
When tracking a new file or removing a file from tracking, a few extra step are required.
-
Open the
makesymlinks.shfile in vimvim ~/dotfiles/makesymlinks.sh -
Scroll to the Variables section and update the line
files="..."to be a space separated list of all dotfiles in the specified directory
########## Variables
dir=~/dotfiles # dotfiles directory
olddir=~/dotfiles_old # old dotfiles backup directory
# update files to match dir
files="bashrc vimrc bash_profile bash_aliases gitconfig" # list of files/folders to symlink in homedir
##########Remember in vim pressing i enters insert mode
- Close and save with
Escthen:wq git commitwith a descriptive message of changesgit push
- The Smalley Creative Blog
Using Git and Github to Manage Your Dotfiles