Skip to content

Instantly share code, notes, and snippets.

@lstor
Last active April 3, 2016 18:35
Show Gist options
  • Select an option

  • Save lstor/1f858accec946ca097defd4307dbf0a0 to your computer and use it in GitHub Desktop.

Select an option

Save lstor/1f858accec946ca097defd4307dbf0a0 to your computer and use it in GitHub Desktop.

Revisions

  1. lstor revised this gist Apr 3, 2016. 1 changed file with 19 additions and 3 deletions.
    22 changes: 19 additions & 3 deletions install_dotfiles.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,21 @@
    echo "Installing dotfiles..."
    git clone --separate-git-dir=$HOME/.dotfiles https://github.com/lstor/dotfiles $HOME/dotfiles-tmp
    cp ~/dotfiles-tmp/.gitmodules ~
    rm -r ~/dotfiles-tmp/

    # Clone repo
    git clone --bare --separate-git-dir=$HOME/.dotfiles https://github.com/lstor/dotfiles $HOME/dotfiles-unused

    # Move submodules, if any
    if [ -x ~/dotfiles-tmp/.gitmodules ]; do
    cp -v ~/dotfiles-tmp/.gitmodules ~
    fi

    # Configure
    alias cfg='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
    cfg config --local status.showUntrackedFiles no

    # Remove tmp dir
    rm -vr ~/dotfiles-tmp/

    # Get files from bare repo
    cfg checkout

    echo "Installation done!"
  2. lstor created this gist Apr 3, 2016.
    5 changes: 5 additions & 0 deletions install_dotfiles.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    echo "Installing dotfiles..."
    git clone --separate-git-dir=$HOME/.dotfiles https://github.com/lstor/dotfiles $HOME/dotfiles-tmp
    cp ~/dotfiles-tmp/.gitmodules ~
    rm -r ~/dotfiles-tmp/
    echo "Installation done!"