Guest User

Untitled

a guest
Sep 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. Sharing your Git repository using Git daemon (for pull & push)
  2.  
  3. 1. In a git repository run the following command to share it in read-only mode (pull only):
  4.  
  5. git daemon --export-all
  6.  
  7. and you can then connect to it from a remote machine:
  8.  
  9. git clone git://yourmachine/path/to/repo
  10. or
  11. git pull git://yourmachine/path/to/repo
  12. or
  13. git ls-remote git://yourmachine/path/to/repo
  14.  
  15. 2. In order to be able to pushing to your local repository from a remote machine you need to enable receive-pack:
  16.  
  17. git daemon --export-all --enable=receive-pack
  18.  
  19. then you can push like this:
  20.  
  21. git push git://yourmachine/path/to/repo
  22.  
  23. 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)
Add Comment
Please, Sign In to add comment