Skip to content

Instantly share code, notes, and snippets.

@Soulwest
Created November 26, 2016 23:35
Show Gist options
  • Save Soulwest/b01e8852521d01f4f6709d917b086dfd to your computer and use it in GitHub Desktop.
Save Soulwest/b01e8852521d01f4f6709d917b086dfd to your computer and use it in GitHub Desktop.
Add directory to git
#!/bin/bash
DIR=$1
read -e -p "Enter git repo:" REPO
#echo $REPO
#echo $DIR
set -e
cd $DIR
git init .
git add *
if [ -f .htaccess ]; then
git add .htaccess
fi
git commit -m 'Add directory'
git remote add origin $REPO
git push origin master:static
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment