Windows: LANå å°ç¨ã®Gitãªã¢ã¼ããªãã¸ããªãä½ã
(æçµæ´æ°: 2015-12-04)
ç®æ¬¡
- è¦æ
- çµè«
- Gitãµã¼ãã¼ãä½ã
- Gitãµã¼ãã¼ãèµ·åãã
- ã°ã«ã¼ãéçºãå§ãã
è¦æ
ã°ã«ã¼ãéçºã®ããã«LANå
ã ãã®Gitãªãã¸ããªãã»ããã
å¤é¨ã«ã¯å
¬éããªãã
çµè«
å¿
è¦ãªã³ãã³ãã ããã¾ã¨ãã¾ãã
詳ããã¯ä»¥éã®ç« ã§èª¬æãã¾ãã
ç°å¢ä¾
- Gitãµã¼ãã¼ãç½®ãæ©å¨å:
XPS8700
- Gitãµã¼ãã¼å:
sample.git
- ãããã¯ã¼ã¯ãã¹:
\\XPS8700\sample.git
- ãªã¢ã¼ãå:
origin
ã³ãã³ã
Gitãµã¼ãã¼ä½æ
$ mkdir sample.git $ cd sample.git $ git init --bare --shared=true $ touch git-daemon-export-ok
æ¢åãªãã¸ããªããç¶ç¶ããå ´å
$ git remote add origin //XPS8700/sample.git $ git push origin master
åã¡ã³ãã¼ãã¯ãã¼ã³ãã¦æºåå®äº
$ git clone //XPS8700/sample.git
Gitãµã¼ãã¼ãä½ã
ã¾ããä»»æã®å ´æã«ãã©ã«ããä½ã£ã¦å
±æãã¾ãã
ååã¯xxxx.git
ã¨ããã®ãæµåã ããã§ãã
- ãã¼ã«ã«ãã¹:
C:\Users\Yuusaku\Documents\sample.git
- ãããã¯ã¼ã¯ãã¹:
\\XPS8700\sample.git
ã¾ãã¯IPã¢ãã¬ã¹ã§è¡¨è¨ããã\\192.168.1.100\sample.git
次ã«ãGitãµã¼ãã¼ã¨ãã¦åæåãã¾ãã
git-daemon-export-ok
ãä½æãã¦ãèªè¨¼ãçãã¦ä½¿ãããããã¾ãã
LANå
å°ç¨ãªã®ã§ããã§ãã¾ãã¾ããã
$ git init --bare --shared=true $ touch git-daemon-export-ok
–bare
Create a bare repository. If GIT_DIR environment is not set, it is set to the current working directory.
–shared[=(false|true|umask|group|all|world|everybody|0xxx)]
Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable “core.sharedRepository” is set so that files and directories under $GIT_DIR are created with the requested permissions. When not specified, Git will use permissions reported by umask(2).
- æç²å¼ç¨: Git - git-init Documentation
(git-daemon-export-ok ã«ã¤ãã¦)
ãã®ãã¡ã¤ã«ãåå¨ããããã¸ã§ã¯ãã«ã¤ãã¦ã¯ãGit ã¯èªè¨¼ãªãã§å ¬éãã¦ããããã®ã¨ã¿ãªãã¾ãã
- å¼ç¨: Git - Git ãã¼ã¢ã³
Gitãµã¼ãã¼ãèµ·åãã
ä¸è¨ã®ã³ãã³ãã§Gitãµã¼ãã¼ãèµ·åãã¾ãã
ãã ãç§ã®ç°å¢ã§ã¯ä½æ
ãä¸è¨ã®ã³ãã³ããå®è¡ããªãã¦ããpushãpullãcloneãå¯è½ã§ãã
$ git daemon --export-all --enable=receive-pack
–export-all
Allow pulling from all directories that look like Git repositories (have the objects and refs subdirectories), even if they do not have the git-daemon-export-ok file.
–enable=<service>
–disable=<service>
Enable/disable the service site-wide per default. Note that a service disabled site-wide can still be enabled per repository if it is marked overridable and the repository enables the service with a configuration item.
SERVICES
receive-pack
This serves git send-pack clients, allowing anonymous push. It is disabled by default, as there is no authentication in the protocol (in other words, anybody can push anything into the repository, including removal of refs). This is solely meant for a closed LAN setting where everybody is friendly. This service can be enabled by setting daemon.receivepack configuration item to true.
- æç²å¼ç¨: Git - git-daemon Documentation
ã°ã«ã¼ãéçºãå§ãã
ã¯ãã¼ã³
éçºã¡ã³ãã¼ãããããã®ãªãã¸ããªã«cloneãã¾ãã
$ git clone //XPS8700/sample.git $ git clone //192.168.1.100/sample.git # IPã¢ãã¬ã¹ã§ãæå®ã§ãã
ãã¹ã¯git://
, file://
, ssh://
, https://
ãªã©ã§ã¯ãªããUNCã§æå®ãã¾ãã
ããã«ãªããªãæ°ã¥ããªãã£ãâ¦orz
æ¢ã«éçºä¸ã§ãå¾ããGitãå©ç¨ããããªã£ãå ´å
代表è ãæ¢åã®ãªãã¸ããªã«ãªã¢ã¼ãã追å ããpushãã¾ãã
$ git remote add origin //XPS8700/sample.git $ git push origin master
ãã®å¾ãä¸ã®ããã«åã¡ã³ãã¼ãcloneãã¾ãã