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
@4thex
Copy link

4thex commented Nov 12, 2022

This is great. Since Google Drive for Desktop mounts a drive on Windows 10, a folder on that drive can be used as the origin. I haven't tried this yet, but I will.
Instant unlimited private git repositories.
I wonder if this also works with sharing on a team.

@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