ä»åã¯githubä¸ã«ä¸ãã£ã¦ãããªãã¸ããªå ã®ãµããã£ã¬ã¯ããªã®ã¿ãåå¾ããæ¹æ³ã«ã¤ãã¦ã¾ã¨ãããã¨æãã¾ãã
æè¿åèã«ãããã³ã¼ãããã¼ã«ã«ã«ãã¦ã³ãã¼ããããã¨æã£ãã®ã§ããã
ãªãã¸ããªãã¨ã¦ã大ããã£ãã®ã§æ¬²ããã³ã¼ãã ãæã£ã¦ãããªããï¼ã¨æãã
調ã¹ãã¨ãããæ¹æ³ããã£ãã®ã§ãã®åå¿é²ã«ãªãã¾ãã
- â åæºå
- â sparsecheckoutãç¨ãã¦ãµããã£ã¬ã¯ããªã®ã¿ãåå¾ããã
- â è£è¶³
- â æå¾ã«
- â åè
â åæºå
ã¾ããã¦ã³ãã¼ããè¡ãããã®ãã£ã¬ã¯ããªãä½æãã¦ããã¾ãã
mkdir TestDir #é©å½ãªãã£ã¬ã¯ããªå cd ./TestDir git init git remote add origin https://hogehoge~~ #ãªãã¸ããªã®è¨å®ãè¡ã
â sparsecheckoutãç¨ãã¦ãµããã£ã¬ã¯ããªã®ã¿ãåå¾ããã
ãªãã¸ããªå
ã®ãµããã£ã¬ã¯ããªã®ã¿ãåå¾ããã«ãããã
âsparsecheckoutâã¨ããã³ãã³ããç¨ãã¾ãã
sparsecheckoutãç¨ãããã¨ã«ãããgitãªãã¸ããªã®ä¸é¨ã®ã¿ãåå¾ã§ããããã«ãªãã¾ãã
â»sparseã¨ã¯"ããããª"ã¨ããæå³ã ããã§ãã
ã¾ãã¯sparsecheckoutã®è¨å®ãtrueã«ãã¦ããã¾ãã
git config core.sparsecheckout true
次ã«åå¾ããããµããã£ã¬ã¯ããªãsparse-checkoutã«è¨å®ãã¦ããã¾ãã
echo ãµããã£ã¬ã¯ããªãã¹ > .git/info/sparse-checkout
ããã§ãè¨å®ãããµããã£ã¬ã¯ããªãã¹ã§ããã
ãªãã¸ããªãããããã£ã¬ã¯ããªã¨ããæã®ãã¹ãå
¥åããã°ããã§ãã
ä¾ãã°ããã¡ãã®ãªãã¸ããªã®sampleã®ã¿ãåå¾ãããå ´åã«ã¯ã
https://github.com/Elsammit/ScreenCapture
ä¸è¨ã®éãã³ãã³ãå®è¡ããã°OKã
echo sample > .git/info/sparse-checkout
ãããã¯ã
vim .git/info/sparse-checkout
ã§ãã¡ã¤ã«ç·¨éã«ã¦ãµããã£ã¬ã¯ããªãè¨è¼ãã¦ãOKã
ãã¦ã³ãã¼ããããµããã£ã¬ã¯ããªã¯è¤æ°é¸æå¯è½ã§ã
2ã¤ç®ä»¥éã¯ã
echo ãµããã£ã¬ã¯ããªãã¹ >> .git/info/sparse-checkout
ã¨sparse-checkoutã«è¿½è¨ããå½¢ã§ã³ãã³ãå®è¡ããã°OKã
â»vimã§ãã¡ã¤ã«å
ã«è¿½è¨ãã¦ããã§ãOKã§ãã
æå¾ã«ã
git pull origin main #ãã©ã³ãåã¯é©å®å¤æ´
ãå®è¡ãã¦ãã¦ã³ãã¼ãããã°OKã
â è£è¶³
sparse-checkoutã§ãã¦ã³ãã¼ããããã¡ã¤ã«ãé¤å¤ããéã«ã¯ã
vim .git/info/sparse-checkout
ã¨ãã¦ãã¡ã¤ã«ç·¨éã«ã¦ã
!ãµããã£ã¬ã¯ããªå
ã¨é ã«ããã¯ãªãã¼ã¯ãä»ä¸ããã°OKã
â æå¾ã«
ä»åã¯githubãªãã¸ããªã®ä¸é¨ãµããã£ã¬ã¯ããªã®ã¿ããã¦ã³ãã¼ãããæ¹æ³ã«ã¤ãã¦ã¾ã¨ãã¾ããã
ã©ãããgitä¸ã«pushãããæ
å ±ã¯å
¨ã¦åãè¾¼ãã ä¸ã§ãµããã£ã¬ã¯ããªã®ã¿ãpullãã¦ããããã§ãã
ãã®ããããããªãã«æ´æ°é »åº¦ã®é«ããªãã¸ããªã¯pullæã«ãã¦ã³ãã¼ãæéãå°ãé·ãããã§ãã