Created
June 25, 2017 15:30
-
-
Save johannes-staehlin/a3de7f6c389c669e068557b70ae9290c to your computer and use it in GitHub Desktop.
Initialize a new git repository with Google Drive folder as origin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.