Skip to content

Instantly share code, notes, and snippets.

@johannes-staehlin
Created June 25, 2017 15:30
Show Gist options
  • Save johannes-staehlin/a3de7f6c389c669e068557b70ae9290c to your computer and use it in GitHub Desktop.
Save johannes-staehlin/a3de7f6c389c669e068557b70ae9290c to your computer and use it in GitHub Desktop.
Initialize a new git repository with Google Drive folder as origin
# Initialize a new git repository with Google Drive folder as origin
export GOOGLE_DRIVE_DIRECOTRY=~/Google\ Drive/git-repositories
export WORKING_DIRECTORY=$(pwd)
export REPOSITORY=$GOOGLE_DRIVE_DIRECOTRY/${WORKING_DIRECTORY##*/}
mkdir -p "$REPOSITORY"
cd "$REPOSITORY"
git init --bare
cd $WORKING_DIRECTORY
touch README
git init
git add README
git commit -m "Initial commit."
git remote add origin "$REPOSITORY"
git push origin master
@Ddowell433
Copy link

I don't even have a Google Drive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment