Skip to content

Instantly share code, notes, and snippets.

@colwilson
Created January 17, 2012 22:18
Show Gist options
  • Save colwilson/1629349 to your computer and use it in GitHub Desktop.
Save colwilson/1629349 to your computer and use it in GitHub Desktop.
Create Git origin on Ubuntu One
#!/usr/bin/env bash
#set -x # debugging
if [ -z "$1" ]
then
echo "please supply a repo name!"
exit
fi
# set the new repository name
proj=$1
proj_dir=~/Projects
repo_dir=~/git_on_ubuntu_one
repo=${proj}.git
# ln -s Ubuntu\ One/git/ git_on_ubuntu_one
# create origin
cd ${repo_dir}
mkdir ${repo}
cd ${repo}
git init --bare
# create local repo
cd ${proj_dir}
mkdir ${proj}
cd ${proj}/
git init
touch README
# do your first push back to master
git add .
git commit -am "repository ${proj} pushed to origin"
git remote add origin ${repo_dir}/${repo}
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment