Skip to content

Instantly share code, notes, and snippets.

@laszlomiklosik
Last active October 18, 2021 17:22
Show Gist options
  • Save laszlomiklosik/2230082 to your computer and use it in GitHub Desktop.
Save laszlomiklosik/2230082 to your computer and use it in GitHub Desktop.
Sharing your Git repository using Git daemon
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)
@rfc-2549
Copy link

Is it possible that make git ask for a username and password when pushing?

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