Last active
November 8, 2017 13:44
-
-
Save harrytallbelt/bab45ef5ba0206657a3a0383b97ae317 to your computer and use it in GitHub Desktop.
Create a local bare repo, you can (put in Dropbox folder) use like remote.
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
# Create a new bare repo. | |
cd origin-parh | |
mkdir repo.git | |
cd repo.git | |
git --bare init | |
# Make an already existing repo bare. | |
cd origin-parh | |
mkdir repo | |
cd repo | |
git init | |
cd .. | |
mv repo/.git repo.git | |
rm -rf repo | |
cd repo.git | |
git config --bool core.bare true | |
# Working with a bare repo. | |
cd working-path | |
git clone origin-path/repo.git | |
echo 'Changes' > new-file.txt | |
git commit -a -m "Commit" | |
git push origin master | |
# (Re)setting remote | |
cd working-path/repo | |
git remote remove origin | |
git remote add origin origin-path/repo.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment