Skip to content


Add ability to use symlink. #301

wants to merge 2 commits into from

5 participants


Might not be desired, but I don't want to copy the dotfiles, I want to link them. This was mainly a hack for me and a bunch of friends who like this repo, but want to link instead of copy.

Issue: Kills the --force full name flag because I don't flesh out the getopts call.


@johnmetta Yep. I ran into the same thing. That's why I started this:

See context: #300


This looks attractive to me. Are other folks symlinking their dotfiles as such?

I'd really like to get my git config --global commands back in automatically. And this would just make maintenance a touch easier.

cc @callumlocke


From @mathiasbynens in #9 (comment) :

@gburtini Actually, using symlinks was the first thing that I tried. I ended up with “recursion too deep” errors though, even though they were simple ~/.foo → ~/dotfiles/.foo links. Any idea of what I was doing wrong?


@alrra has some sweet symlinking up in

looks great.

@paulirish paulirish referenced this pull request in paulirish/dotfiles

Symlinks? #30

@johnmetta johnmetta closed this

@johnmetta not sure why you're closing this. I think it should remain open as symlinking has huge advantages.
Unless you've changed your mind?


Just saying: I'm symlinking with an install script and .bash_profile sourcing stuff. Works like a charm (just clean installed Yosemite)

@mathiasbynens mathiasbynens reopened this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 5, 2013
  1. @johnmetta
  2. @johnmetta

    Update readme

    johnmetta committed
Showing with 42 additions and 4 deletions.
  1. +10 −0
  2. +32 −4
@@ -42,6 +42,16 @@ Here’s an example `~/.path` file that adds `~/utils` to the `$PATH`:
export PATH="$HOME/utils:$PATH"
+### Link instead of copy files
+```$ bootstrap -l```
+or using ```source```
+set -- -l; source
### Add custom commands without creating a new fork
If `~/.extra` exists, it will be sourced along with the other files. You can use this to add a few custom commands without the need to fork this entire repository, or to add commands you don’t want to commit to a public repository.
@@ -1,18 +1,46 @@
#!/usr/bin/env bash
cd "$(dirname "${BASH_SOURCE}")"
git pull origin master
function doIt() {
rsync --exclude ".git/" --exclude ".DS_Store" --exclude "" \
--exclude "" --exclude "LICENSE-MIT.txt" -av --no-perms . ~
- source ~/.bash_profile
-if [ "$1" == "--force" -o "$1" == "-f" ]; then
- doIt
+function linkIt() {
+ FILES=$(find . -type f -maxdepth 1 -name ".*" -not -name .DS_Store -not -name .git -not -name .osx | sed -e 's|//|/|' | sed -e 's|./.|.|')
+ for file in $FILES; do
+ ln -sf $(dirname "${BASH_SOURCE}")/${file} ~/${file}
+ done
+while getopts "fl" opt; do
+ case "$opt" in
+ f)
+ ;;
+ l)
+ LINK=1
+ ;;
+ esac
+if [ "$FORCE" == "1" ]; then
+ if [ "$LINK" == "1" ]; then
+ linkIt
+ else
+ doIt
+ fi
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1
if [[ $REPLY =~ ^[Yy]$ ]]; then
- doIt
+ if [ "$LINK" == "1" ]; then
+ linkIt
+ else
+ doIt
+ fi
+source ~/.bash_profile
unset doIt
Something went wrong with that request. Please try again.