Last active
October 18, 2021 17:22
-
-
Save laszlomiklosik/2230082 to your computer and use it in GitHub Desktop.
Sharing your Git repository using Git daemon
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
Sharing your Git repository using Git daemon (for pull & push) | |
1. In a git repository run the following command to share it in read-only mode (pull only): | |
git daemon --export-all --base-path=. | |
(from the folder with the project to be shared) | |
and then clone directly, like: | |
git clone git://192.168.31.106/ destination_folder_name | |
git pull git://192.168.31.106/ | |
2. In order to be able to pushing to your local repository from a remote machine you need to enable receive-pack: | |
git daemon --export-all --base-path=. --enable=receive-pack | |
then you can push like this: | |
git push git://192.168.31.106/ | |
Note: you cannot push to a checked out branch! (just switch the branch using git checkout on the destination machine before trying to push to it) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible that make git ask for a username and password when pushing?