ä¸äººã§ã½ã¼ã¹ç®¡çãã¦ããããæ£ç´ãã¢ãªãã¸ããªãªãã¦è¦ããªãã¨æã£ã¦ããã§ããæè¿ããã£ã¦ããªãã¸ããªã§ãã©ã³ããæ¶ããªãäºæ ã«ééã幸ããææ°ã® master ã¯ç¡äºã ã£ãããåé¡ã¯ãªãã£ããã©ããããã«ãã¤ãã¨ãããããã§ãä¿éºã¨ãã¦Gitã®ãã¢ãªãã¸ããªãç¨æãããã¨ã«ãã*1ã
GitHubã®ã¢ã«ã¦ã³ãã¯ä»ãä½ã£ã¦ãªãã®ã§ã代ããã«XigmaNASã«ãã¢ãªãã¸ããªãç½®ãã¦éç¨ããæ¹éã«æ±ºããã
XigmaNASã«Gitãç½®ããã¨ããã
æåã¯ãXigmaNASãªãGitãããåãã ãããã£ã¦è»½ãè¦ã¦ããã§ããå®éã¯Gitãå ¥ã£ã¦ãªãããç¡çããã¤ã³ã¹ãã¼ã«ãããã¨ãã¦ã容éä¸è¶³ã§æãããå§æ«ãä»æ¹ãªããNASãSMBã§Linuxã«ãã¦ã³ããã¦ãLinuxä¸ã§Gitãåããå½¢ã«è½ã¡çããããã¡ã¤ã«ã®å®ä½ã¯NASä¸ã«ãããããå¤å°ã¯ãã·ã ããã¨ããå¤æã ã
è¨å®æé
NASå´ã®æºå
Gitç¨ã®ã¦ã¼ã¶ã¼ï¼gituserï¼ãXigmaNASä¸ã«ä½æããSMBã§å ±æããGitç¨ãã©ã«ããè¨å®ããã
Linuxãããã¦ã³ã
ä½æããå ±æãã©ã«ããLinuxå´ãããã¦ã³ãããã以ä¸ã®ã³ãã³ãã使ç¨ãããnoperm ãªãã·ã§ã³ã¯NASå´ã®æ¨©éã§èªã¿æ¸ãããããã«å¿ è¦ã
sudo mount -t cifs //XigmaNASã®ã¢ãã¬ã¹/git_share Linuxå´ã®ãã¦ã³ãå -o username=gituser,password=è¨å®,noperm
ãã¢ãªãã¸ããªã®å©ç¨
mountå¾ãæ®éã«Gitã®ãã¢ãªãã¸ããªãä½æãã git push origin master
ã使ããããã«ã
ä»ã®ã¨ããã git push
ã¯é »ç¹ã«ã¯è¡ããªãã®ã§ãä¸è¦ã«ãªã£ããããã« umount ããéç¨ã«ãã¦ããã
post-receiveã®è¨å®
念ã®ããã git push
å¾ã«ãã£ãã·ã¥ãæ¸ãåºãããã« sync
ãè¡ãã ãã® post-receive ããã¯ãè¨å®ããããã ããããã©ãã ãå¹æãããã¯æ£ç´ä¸æã ã
ãã¹ã¦ã®ãã¢ãªãã¸ããªã«æ¯å post-receive ãæ¸ãã®ã¯æéã ã£ãã®ã§ãGitã®ãã³ãã¬ã¼ãæ©è½ãæ´»ç¨ãããã¨ã«ããããã³ãã¬ã¼ããã©ã«ãã«ããã¯ã®éå½¢ post-receive.sample ãç½®ãã¦ãå¿ è¦ãªã¨ãã ãååãå¤ãã¦ä½¿ãããã«ããã
~/.git-templates/hooks/post-receive.sample
ãæ¸ãã¦
#!/bin/sh sync
以ä¸ã§ãgitã®è¨å®ã«ããã
git config --global init.templateDIR ~/.git-templates
XigmaNASä¸ã®Gig bearã¯Windowsããã§ã使ããã
ããã¾ã§è¨å®ãã¦ããã¦ããµã¨ãWindowsãã·ã³ãããã®NASã®ãã¢ãªãã¸ããªã«ã¢ã¯ã»ã¹ã§ããã®ããªï¼ãã¨ä¸å®ã«ãªã£ããå¤åãSMBã§å ±æã§ããã°Windowsããã使ããã¯ããèªåã®ããã°ã©ã ã¯ãã«ããã©ãããã©ã¼ã 対å¿ã®ã¨ãããããWindowsã§ã®åä½ç¢ºèªã微調æ´ãã§ããã¨å©ãããã ããªãã
AIå
çã«ããã¨ãããã¯ã¼ã¯ãã¹ã§Git pull/pushã¯æ¨å¥¨ããªããããªã®ã§ãzãã©ã¤ãã«ãã¦ã³ããããã¨ããã
ãã£ããã git clone /z/my_projects/pomodoro.git
ã¨ããã¨
fatal: detected dubious ownership in repository at 'Z:/my_projects/pomodoro.git' 'Z:/my_projects/pomodoro.git' is owned by: (inconvertible) (S-1-5-21-2768214786-1361613841-632331992-1000) but the current user is: YYYYYYYY/XXXXX (S-1-5-21-3988748606-2148608539-3574766069-1001) To add an exception for this directory, call: git config --global --add safe.directory Z:/my_projects/pomodoro.git fatal: Could not read from remote repository.
ã¨è¨ã£ã¦ãããææè
ã®ä¸ä¸è´ã¨è¨ã£ã¦ããã®ã§ãã¨ã©ã¼ã¡ãã»ã¼ã¸ã®ã¾ã¾ git config
ãè¡ããã¨ã§ãgit pullã¯åºæ¥ãã
ä»ãWindowsä¸ã§åããç©ã¯ãªãã®ã§ç¢ºèªããªãã£ãããpullã¾ã§ã§ããã°pushåºæ¥ãã§ããã
*1:è¤æ°ãã·ã³ã§ä½æ¥ããã¨ãã ãããã®å ´ãã®ãã§åããã©ã«ãã«ãã¢ãªãã¸ããªãä½ã£ã¦ã