Skip to content

Instantly share code, notes, and snippets.

@nbrew
Created July 5, 2011 21:32
Show Gist options
  • Save nbrew/1066010 to your computer and use it in GitHub Desktop.
Save nbrew/1066010 to your computer and use it in GitHub Desktop.
Simple script for adding existing project to git/gitosis
# from http://snippets.aktagon.com/snippets/329-Simple-script-for-adding-existing-project-to-git-gitosis
GIT_USER=git
SERVER=xxx.com
APP=xxx
touch tmp/.gitignore log/.gitignore vendor/.gitignore
find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore
cat <<EOF<<EOF >>.gitignore
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
*.swp
Capfile
EOFEOF
git init
git add .
git commit -m "initial commit"
git remote add origin $GIT_USER@$SERVER:$APP.git
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment