Skip to content

Instantly share code, notes, and snippets.

@anthonyfuentes
Last active April 5, 2020 01:34
Show Gist options
  • Save anthonyfuentes/17b77f4f313fc1330b27f9d5c9ef409f to your computer and use it in GitHub Desktop.
Save anthonyfuentes/17b77f4f313fc1330b27f9d5c9ef409f to your computer and use it in GitHub Desktop.
#!/bin/bash
##################
# Install Vundle #
##################
if [ ! -f ~/.vim/bundle/Vundle.vim ]; then
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
###################
# Clone bare repo #
###################
if [ -z "$2" ]; then
git clone --bare $1 $HOME/.cfg
else
git clone --single-branch --bare --branch $2 $1 $HOME/.cfg
fi;
###############################
# Set repo path and work tree #
###############################
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
}
############################
# Attempt to checkout repo #
############################
config checkout
########################
# Update repo settings #
########################
config config status.showUntrackedFiles no
#######################
# Source bash configs #
#######################
source ~/.bashrc
#########################
# Remove README locally #
#########################
config au README.md
rm README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment