Last active
April 5, 2020 01:34
-
-
Save anthonyfuentes/17b77f4f313fc1330b27f9d5c9ef409f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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