git rebase ã¯å±éºã ï¼æªã ï¼ã¨è¨ãã¬ã»ãã¿ã«è¸ããã㦠rebase ãæãããªãã§ï¼ï¼ï¼
rebase ãæãããªã£
rebase ã¯å±éºã ã£ï¼push ããã¦ãå ´å㯠rebase ãããªï¼ãªãã¸ããªãç ´å£ãããã£ï¼çµ¶å¯¾ä½¿ããªã£ï¼ï¼
ãããªè ãæå¥ã«è¸ãããã人ã 㯠rebase ã«æããã®ã®ãå ¨åã§éãåºãç解ãããããã¨ããªããªã£ãçµæãä»æ¥ããã°ãèãã¦ãã¾ãã
ç§ã¯æ²ããã§ãã
rebase ã¯å ¨ãæããªãã¦è¯ããã§ãï¼ããããããªããå¨ãã¾ããï¼ï¼
æ¬æ¥ä¸çªèªç¶ãªæµããä½ãåºãããã®ã§ãã®ã§ããã²ç解ãã¦æ´»ç¨ãã¾ãããã
ã£ã¦ãªããã§ã訳ã®åãããªãå¤ãªåªç¸ãã解ãæ¾ã¤ããã®æå©ããä»ãããããã¾ãã
rebase ã¯1ã¤ã®ãã©ã³ããªãã°å¤äººæ°ã§ããã£ã¦ããå ´åã§ãå ¨ãåé¡ç¡ãã¨è¨ãããmerge ã®æ¹ãå§åçã«å ·åãæªãã§ãã
rebase å®é¨
å®é¨ããã¨ããããããã§ããããã£ã¦ã¿ã¾ãããã
ãããã®åã«ä»¥ä¸ãå®è¡ãã¦ãã ããã
git config --global mergetool.keepBackup false
orig ã ã® BACKUP ã ã®ä½ãã®ãã¤ã¡ããã¾ãã
(ããããè« --abort ã ã® reset ã ã®ããããã ãããããªããã®å¿
è¦æ§ãå
¨ãç¡ã鬱é¶ããã ãã§ãã clean -f ãæ¯åå©ãã®ã¦ã¶ããã§ã)
æ¬ãµã¤ãã§ã¯ mergetool ã«ã¯ vimdiff ã使ãäºãå¼·ãæ¨å¥¨ããã¨è¨ãããvim 使ãã¾ãããããã以å¤èªãã¾ããã
ãªã®ã§ä»¥ä¸ã®è¨å®ãæ¨å¥¨ã§ãã
git config --global merge.tool vimdiff
[TODO]
rebaseãmarge ã§ã®ã³ã³ããªã¯ã解決ã®æ¹æ³ãvimdiff ã®ä½¿ãæ¹ãæ©å«ãè¯ãæã«ä¸å¯§ã«æããè¨äºãè¼ããã
ãã®ä¸ã§ä»¥ä¸ãå®è¡ãã¦ã¿ã¦ãã ããã
[ Core ]
mkdir -p ~/git-test/remote/test cd ~/git-test/remote/test git init --bare cd ~/git-test git clone ~/git-test/remote/test a git clone ~/git-test/remote/test b echo 'base code' > a/code cd a git add code git commit -m 'first commit' git push cd ../b git pull cd .. cd a echo 'bug fix by a' >> code git add code git commit -m 'bug fix by a' git push cd ..
command ã®è©³ç´°ã¯ã¾ã rebase 使ãããªããã¨ãããããæ°æ¦ã®ããã¨ã³ã¸ãã¢ãªãè¦ãããããã§ããã£ã¦äºã§æ´åçã«èª¬æãçãã¾ãããã¦ã¼ã¶ã¼ a 㨠b ã test ããããã clone ããa ã bug fix ãã¦push ãã¦ããæ§ãä»®æ³çã«è¡ã£ã¦ã¾ãã
a ã¨b ãããããã®ã¦ã¼ã¶ã¼ã®ä½æ¥ãã£ã¬ã¯ããªã ã¨æã£ã¦ãã ããã
ã次ã«ã以ä¸ãå®è¡ãã¦ã¿ã¾ãããã
[ Bug fix by b ]
cd b echo 'bug fix by b' >> code git add code git commit -m 'bug fix by b'
b ãããã« bug fix ãã¾ããã¨ã
ãã㧠b ã push ãã¦ã¿ãã¨
git push // Error
a ã push ãã¦ã¦ remote å´ãæ°ãããªã£ã¦ããããpull ããã£ã¤ã£ã¦æããã¾ãã
ãªã®ã§ä»¥ä¸ã§ rebase ãã¦ãã³ã³ããªã¯ã解æ¶ã㦠push ããã¨ãã¾ãã
(注: 以ä¸ã® shell ã¯è²¼ãä»ãã¦ä¸æ°ã«å®è¡åºã¾ãããmergetool 㨠rebase --con ã§ã¨ãã£ã¿éãã®ã§1è¡1è¡å®è¡ãã¾ããã)
git pull -r git mergetool git rebase --con git push
ããããã¨ãã°ã¯ãããªæãã«ãªãã¾ãã(ã¡ãªã¿ã«ãã®ãã°ã¯ tig ã®ãã°ã§ããèªå tig ããåããã¨æã£ã¦ãã®ã§)
o [master] {origin/master} bug fix by b o bug fix by a I first commit
a ããã£ãä¿®æ£ã®ä¸ã«ãèªåã®ä¿®æ£ãä¹ã£ãã£ã¦ãèªç¶ãªãã°ã§ããã
ãã rebase ã£ã¦èªåã® push ãã¦ãªã commit ã remote å´ã®ææ°å¼ã£å¼µã£ã¦ãã¦ä¹ã£ããªããå¦çã ããå½ç¶ãããªãã¾ãã
svn ã¨ã cvs ã®åä½ã«è¿ãã¦ãå
¨ãä¸èªç¶ããæããç解ããããã§ãããã
merge å®é¨
ãããä»åº¦ã¯é¦¬é¹¿ã¿ããã« merge ãã¦ã¿ã¾ãããããgit ã®åªããå ªè½ã§ãã
~/git-test 以ä¸ãå ¨é¨æ¶ãã¦å®é¨ã³ã¼ã[ Core ] 㨠[ Bug fix by b ] ãå®è¡ãã¦ãã ããã
ãã®å¾ b ã§ä»¥ä¸ãå®è¡ã㦠merge ãã¾ãã
git pull
git mergetool
git merge --con
git push
ã¡ãªã¿ã« pull ã®éãã¨ã©ã¼ãåºãå ´åã¯ã
git config --global pull.rebase false
ãå®è¡ãã¦ãã ãããpull ã®ããã©ã«ãæåã merge ã«ãªãã¾ãã以åã¾ã§ãããªè¨å®ããã¨ãã¨ã©ã¼ã«ãªããªãã£ããã§ãããä½è¨ãªãä¸è©±ãå ¥ãã¾ããã
marge ããçµæã®ãã°ã以ä¸ã§ãã
Mââ [master] {origin/master} Merge branch 'master' of /home/xxx/git-test/remote/test â o bug fix by a o â bug fix by b Iââ first commit
ãã£ã㯠3 è¡ã ã£ãã®ã 4 è¡ã«å¢ããå·¦å´ã®é¨åãè¦ã¥ãããªãã¾ãããã
ããã«ãæç³»åçã« bug fix by a ãå
ãªã®ã«ãå¾ã«è¦ããããã«ãªãæ··ä¹±åºæ¥ã¾ããé常ã«ãããããã§ããã
ã¾ãã«ãããã¼ãããã¼ãã¼ã¼ããã¼ã¼ã¼ãããããããããã¼ã¼ããã¼ã¼ã¼ã§ãã
ã¾ããããã remote ã® commit ãå è¡ããããã ãããããã¤ãèªåã¨ããã®ä¸çªã±ãã«ãã·ãã¨ãã£ã¤ãã¦ãããã« merge ã§åãè¾¼ã¿ã¾ãããï¼ã¨ããããè¿·æ㪠commit ãä½ã£ã¦ããããããããªããã§ãã
ãããremote å´ã«ãã¾ã local ã«åãè¾¼ãã§ããªã commit ãåå¨ããéã« push ãããã¨ããã¨ãæ¯åº¦ãããªãã¾ãã
ããã§ãã°ãæé«ã«æ±ããªã£ã¦ãã°ãéããã³çµ¶é ãè¿ãããã¨ã«ãªãã¾ãã
ãã¸æé«ï¼ï¼ãããã¨ããªã¼ãã¹ï¼ï¼
rebase ä¸æ
merge ã¯ãã¾ãã«æé«ããã¦çµ¶é ãè¿ããããããåºæ¬çã« rebase ä¸æã§ãã
ãªã®ã§
git config --global pull.rebase true
ãã¦ãè¯ãã§ããããã¨
git pull
ã
git pull -r
ã¨ããªãã«ãªãã®ã§ããã®å ´å merge ãããã¨ããã¨
git pull --no-rebase
ã¨ãªãã·ã§ã³ãé·ããªãã¾ãããã¾ã merge ããæ©ä¼ã®æ¹ãå°ãªãã®ã§è¯ããã¨æãã¾ãã
ããèªåã¯ããæç㧠git pull -r ã¨ãã£ã¡ããããæ®æ®µã¯ tig ã§ãã£ã¦ããã§ãã®è¨å®ã¯ãã¦ãªãã§ã(ç §)ã
merge ã®æ··ä¹±
ã¡ãªã¿ã« remote å´ãä¸å触ããã¦ããªã merge 㯠rebase ã¨åãçµæã«ãªãã¾ãã
ããã ff ã§ãããã¬ã³ããªã¼ãã¡ã¤ã¢ã¼ã§ãããã¡ã¤ãã«ãã¡ã³ã¿ã¸ã¼ã§ãããforfeit ã§ãã surrender 㧠gg ã§ããã¾ãff ã¨ããããªè¨èãã£ãã©ãã§ãè¯ãã®ã§æ°ã«ããªãã§ãã ããã
ã¤ã merge ã®æåã remote ã®æ§åã§å¤ããã®ãã©ãã ã£ã¤ã 話ã§ããããããæ··ä¹±ã®å ãæ¿ãã¢ãªã¤ã¸ã®å«ãããã§ãã
rebase 使ãã¨è¨ã£ã¦ããä»ã®ãã©ã³ãã«å¯¾ãã¦ã³ã¼ãã®çµ±åãè¡ãå ´å㯠rebase -> merge ã¨è¨ãæµãã«ãªãã®ã§ã¡ãã£ã¨æ··ä¹±ããããããã¾ãããããã¯ç§ã®ããã§ã¯ããã¾ãããgit ã®åºæ¥ãæªãã ãã§ãã
rebase ã§çµ±åå ã®ææ°ã³ã¼ããå¼ã£å¼µã£ã¦ãã¨ãã¦ãããããã®ã¾ã¾çµ±åå ã« merge ã§è¿½å ã£ã¦æãã§ãã
ç°¡åã«ããã®æªè³ªãª merge ã®æåãã¾ã¨ããã¨ä»¥ä¸ã®ããã«ãªãã¾ãã
remote å´ã«æ°ãããããç¡ã
rebase ã¨åãã«ãªãã¾ããremote ã®ç¶æ ã«èªåã®å¤æ´ãä¹ã£ããä¸çªèªç¶ãªä»£ç©ã§ãã
remote å´ã«æ°ããããããã
remote ã®å¤æ´ãä»ã®èªåã®å¤æ´ã®ä¸ã«ä½è¨ãªã³ãããã¨ãã¦ä¹ã£ãã¦ããç解ä¸è½ã§å£æªãªä»£ç©ã§ãã
ä»ãã©ã³ãåè¾¼ rebase æã® push --force ã«æ³¨æ
話ãæ»ã㦠rebase ãå ¨ãåé¡ãªããï¼ã¨è¨ãã¨åé¡ãçºçããå ´åãããã¾ãã
ãã㯠ä»ãã©ã³ããåãè¾¼ãå ´åããã¤èªåã rebase ã®ä½æ¥ä¸ã«èª°ãããã©ã³ãã« push ããå ´åã§ãããã® push ãæ¶ãå¯è½æ§ããããã§ãã
åããã¥ããã§ããããç¾å®çãªã·ãã¥ã§èª¬æãã¾ãã
master ããæ°æ©è½éçºã®ããã« dev ãã©ã³ããåãã¾ããã¨ã
a ã dev ã§æ°ããæ©è½ã追å ãã¾ãããããã master ã« merge ããããã« dev ã«å¯¾ãã¦ç¾å¨ã® master 㧠rebase ãã¾ãã
ãã dev ã®å ã¨ãªã£ã master ã«å¤æ´ããã£ãããããåãè¾¼ãã®ã¯å½ããåã§ãããï¼
master ã®ææ°ãåãè¾¼ãã dev ã master ã«çªã£è¾¼ã¿ã¾ããçµããã
æ®éã¯ç¹ã«åé¡ã¯çºçãã¾ããã
ãã ãåé¡ãçºçããã®ããrebase ããå¾ã«ããã©ã³ãã«å¯¾ãã¦å¤æ´ãããããã¤ãããå ´åã§ãã
ãããã®å¤æ´ã push ããã¦ããå ´åããã® commit ãæ¶ãã¾ãããããããããæ°ã¥ããªãããã£ã¨æ¶ããã®ã§ï½ã
ã¾ãæ¶ããã£ã¤ã£ã¦ã reset 使ãã°æ»ããã¯æ»ãããã noob ãé¨ãæ£ããã ãã§ãããã
ãã§ããã㯠rebase ãæªãã®ã§ã¯ãªããrebase å¾ã®ä½æ¥ãã©ã³ããå¼·å¶çã« push ãã
git push -f
ãã¢ãããã£ã¦è©±ã§ãã(ãªãã·ã§ã³é·ãã¦è¦ãã ãã§æ鬱ã«ãªã --force-with-lease ã使ãã°å®å ¨ã£ã¦è©±ã§ããªãã§ãã)
åé¿çã¨ãã©ã説æãã¾ãããã
ä»ãã©ã³ãåè¾¼ rebase å®é¨
ãããã£ããå®é¨ã§ããã¾ãã¯ãåé¡ç¡ã rebase ã§ãã以ä¸ãå®è¡ãã¦ãã ããã
[ Core 2 ]
mkdir -p ~/git-test/remote/test cd ~/git-test/remote/test git init --bare cd ~/git-test git clone ~/git-test/remote/test a git clone ~/git-test/remote/test b echo 'base code' > a/code cd a git add code git commit -m 'first commit' git push cd ../b git pull cd .. cd a git checkout -b dev echo 'new func by a' >> code git add code git commit -m 'new func by a' git push origin dev git branch -u origin/dev cd ../b echo 'bug fix by b' >> code git add code git commit -m 'bug fix by b' git push cd ..
a ã dev ãã©ã³ããä½æããnew func ãå ãã¦ãã¾ãã
ãã®éãb ã master ã«å¯¾ã㦠bug fix ãå
¥ãã¾ããã
以ä¸ã§ãa ã dev ã master 㧠rebase å¾ã« dev ã master ã« push ãã¾ãã
cd a git pull -r origin master git mergetool git rebase --con git checkout master git pull git merge dev git push
ãã®çµæ master ãã°ã¯ä»¥ä¸ã®ããã«ãªãã¾ãã
o [master] {origin/master} new func by a o bug fix by b I first commit
é常ã«ç´ ç´ã§ããããã ããã master 㧠rebase ããå¾ãpush ãã¦ãªããã§ããconflict ã® merge ã大å¤ã ã£ããããå ´åãdev ã®ä»å¾ã®ä¿®æ£ã«åã㦠push ãã¨ãããã§ãããã
ä»ãã©ã³ãåè¾¼ rebase & push å®é¨
[ Core 2 ] å®è¡ãã¦ä»¥ä¸ãå®è¡ãã¦ãã ããã
cd a git pull -r origin master git mergetool git rebase --con git push // Error
push ã§æ»ã«ã¾ããä»ã® master ã®ä¿®æ£ãåãè¾¼ãã ãã®ã remote ã® dev ã¨è¡çªãã¦ãã¾ã£ã¦ããã®ã§ã¨ã©ã¼ã«ãªãã¾ãã
ãªãã ãã ã£ãã rebase ãããè¯ããããï¼ã£ã¤ã£ã¦ rebase ãã¦ã¿ãã¨ãããªé¢¨ã«ãªãã¾ãã
o [dev] new func by a o bug fix by b o {origin/dev} new func by a I [master] first commit
ãããåã commit å¢ãã¾ããã»ã»ã»ããã bug fix 㨠new func ãå ¥ãæ¿ããã¾ãããããããã§ãããdev 㧠rebase ãã¡ããã¾ãããããããããã¡ã§ãã
ããã merge ãã¦ã¿ã¾ããããã
Mââ [dev] Merge branch 'dev' of /home/xxx/git-test/remote/test into dev â o {origin/dev} new func by a o â new func by a o â {origin/master} bug fix by b Iââ [master] first commit
çµãã£ã¦ã¾ãã
ä»ãã©ã³ãåè¾¼ rebase & push --force ã§äººã«è¿·æããããå®é¨
ç´ ç´ãªã¾ã¾ã®åã§ãã¦æ¬²ãããã£ã¦ãªããã§ãremote å´ã local ã§åçç¡ç¨ã§æ¸ãæããã®ã
git push -f
ã§ãã-f 㯠--force ã§ãããã©ã¼ã¹ã®åãããã¡ããããã¡ããã§ãã©ã¼ã³ãã©ã¼ã³ã§ãã
ãã£ããã¼ï¼ããã§è§£æ±ºãã§ãï¼ï¼
ã¨ã¯ãªããããã£ãæ¸ããããã«ãcommit ã¶ã¡æ¶ãåé¡ãçºçããå¯è½æ§ãããã¾ãã
[ Core 2 ] ãå®è¡å¾ã«ã以ä¸ãå®è¡ãã¦ã¿ã¾ãããã
cd a git pull -r origin master git mergetool git rebase --con cd ../b git pull git checkout dev echo 'new func by b' >> code git add code git commit -m 'new func by b' git push cd ..
a ã dev ã« master ã rebase å¾ã« b ã dev ã«å¯¾ãã¦å¤æ´ã追å ãã¦ãã¾ãã
ãã®æãa ã®ãã°ã¯ä»¥ä¸ã
o [dev] new func by a o {origin/master} bug fix by b I [master] first commit
dev ã push ããã¦ããªãã®ã§ã{origin/dev} ããã¾ããã
b ã®ãã°ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãã
o [dev] {origin/dev} new func by b o new func by a I first commit
new func by b ã追å ããã¦ãã¾ããã
ãããa 㧠force 㪠push ããã¦ã¿ã¾ãããã
cd a git push -f cd ..
b 㧠pull ãã¦ãã°ãè¦ã¦ã¿ã¦ãã ããã
o [dev] {origin/dev} new func by a o [master] {origin/master} bug fix by b I first commit
ãã¯ãããï¼ï¼å¾è¼©ã® new func by b ãæ¶ããã£ï¼ï¼ãã¨çºçã§ããã
å°ã£ãäºã«ãããªæãã§ä½ãåºããã«ã£ã¨æ¶ãããã§ãããããªã®ã§æ¶ããäºã«æ°ã¥ããªãå¯è½æ§ããããããããããã§ãã
å¨ãã«è¿·æãããã ä»ãã©ã³ãåè¾¼ rebase & push --force & merge ããã«ã¯ï¼
push -f 㧠--force-with-lease 使ãã¨ãremote å´ã«å¤æ´ããã£ãå ´åã¨ã©ã¼ã«ãªãã®ã§ãrebase ãããªããã£ã¦è©±ãªãã§ãããconflict 解決ä¸ã« push ãããã¨ç¡éã«ã¼ãã®å§ã¾ãã§ãã
ãªã®ã§ããã£ããã§
ãããï¼ã½ã¾ããï¼dev ã rebase ããã³ã´ï¼ææã¡ã® commit ãå ¨é¨ push ããï¼ã
ã¨å¤ã®æ¿ãã¢è¨èªã§å¤§å·ä»¤ããããå ¨é¨ push ãã¦ããã¦ã
ãrebase ãããããpush ãããªãï¼ã
㨠push ãå°ããã°è¯ãã§ããã¤ãããããããªãã§ãã
ã¡ãã㨠b ã« push ãã¦ããã£ãå¾ãæ¹ã㦠rebase ããã¨ä»¥ä¸ã®ããã«ãªãã¾ãã
o [dev] {origin/dev} new func by b o new func by a o {origin/master} bug fix by b I [master] first commit
ãã§ããã® dev ã master ã« merge ããããã§ããããã®æ --squash ãä»ãã¾ããããmaster ã®ãã°ã«éçºã®ãã°ããã¡ããã¡ãå ¥ãã®ãã¸åå¼ãªãã§ã
git checkout dev git pull -r git merge dev --squash git commit
ããã§
o [master] {origin/master} Add new func !! o bug fix by b I first commit
ãããªãã¾ããã¯ãããããã
rebase 㯠ã¦ã¼ã¶ã¼ãå¤ããã¨ããhash ãå¤ããã¨ãããã¾ããããããªããæ®éã©ãã§ãè¯ãã®ã§æ°ã«ããªããã¦è¯ãã§ãã
ã©ãèãã¦ããã°ãæ±ããªãæ¹ãè´å½å·ã ãå¤ããåã追ããã¨æãã°ãªãã¼ã§ã追ãã¾ããã
push --force ã§èªåã® commit ãæ¶ããã¦ãã¾ã£ãå ´åã®å¯¾å¿ä¾
æå¾ã«ããã push -f ã§æ¶ãã¦ãã¾ã£ãå ´åã®å¾©æ´»æ¹æ³ã®ä¸ä¾ãæ¸ãã¦ããã¾ãã
new func by b ãæ¶ããã b ã¯
o [dev] {origin/dev} new func by b o new func by a I first commit
ã ã£ãã®ããrebase ããã¨
o [dev] {origin/dev} new func by a o [master] {origin/master} bug fix by b I first commit
ã¨ãèªåã® commit ãæ¶ãã¡ããã¾ããããç¦ããªãã¦ã OK ã§ãã
git reflog
ã§ãä½æ¥ãªãã¸ããªã®å±¥æ´ã表示ãã¾ãã
aaa75d9 (HEAD -> dev, origin/dev) HEAD@{0}: rebase (finish): returning to refs/heads/dev aaa75d9 (HEAD -> dev, origin/dev) HEAD@{1}: rebase (start): checkout refs/remotes/origin/dev fb23a21 HEAD@{2}: commit: new func by b 8137020 HEAD@{3}: checkout: moving from master to dev c9a59bd (origin/master, master) HEAD@{4}: commit: bug fix by b 71e6fc7 HEAD@{5}: initial pull
以ä¸ããæ¶ãã¡ãã£ãä¿®æ£ã§ãã
fb23a21 HEAD@{2}: commit: new func by b
ãªã®ã§ãhard reset ã使ã£ã¦ãããã¾ã§å®å ¨ã«æ»ãã¾ãã
git reset --hard fb23a21
ã»ãã ã以ä¸ã§ãã
git reset @^ git stash git rebase git pop git commit
reset ã§å±¥æ´ãï¼ã¤æ»ã㦠commit ãåãæ¶ããä¿®æ£ããã³ã¼ãã stash ã«çªã£è¾¼ã㧠rebase ã㦠stash ããæ»ã㦠commit ããªããã£ã¦æãã§ãã
ã§ã¯è¯ã git ã©ã¤ããã
ãããã¯å¿åãªãã¦ããããã¤ã¾ã§æµããã ï¼
æªã ã«å¾ã絶ããªããããã®ãã©ãã«ã
ãã¤ãããã飲é£ããã誹è¬ä¸å·ãåèªæ¯æçã§äººçãç ãæ£ããããã«ãå¾ã絶ããªãç¶æ³ã
ãï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ï½ã£ã¨ãæ°¸é ã«ç¶ãã¦ããã¾ãã
ä½æ ãï¼ï¼
ããããã¯å¿åãã ããªãã¦ãããè延ãã¦ããã®ãåå ã§ãã
ããªããæ¥ç¶ãã¦ãããã®ãµã¤ãã¯ã©ããã£ã¦è¦ã¦ãã¾ããï¼
PCï¼ã¹ããï¼
ãã®åç·ã®å¥ç´ã¯ã©ããªã£ã¦ãã¾ããï¼
ããªãããããã¯ããªãã®å®¶æãå¥ç´ãã¦ã¾ãããï¼
ããã«ã¯ãååãä½æãé»è©±çªå·çã å人æ å ±ããã£ã¤ãç»é²ããã¦ãã¾ãããã
å¿åã§ããªãã§ãç¡ããã§ããã
ããªããæ¥ç¶ãã¦ãããµã¤ãå ¨ã¦ã¨è¨ã£ã¦è¯ããã§ãããã¢ã¯ã»ã¹ãã°ãæ®ãã¦ãããªãã¨ãããªã決ã¾ãã«ãªã£ã¦ãã¾ãã
è¦å¯ãããã®æ¸ãè¾¼ã¿ããã®èª°ã ï¼ã¨èãããéã«çãããããã«ãã¦ãããªãã¨ãããªãããã«ãªã£ã¦ãããã§ãã
æ¥ç¶å ãèãåºããè¦å¯ã¯åç·æ¥è ã«é£çµ¡ãã¦ä½æãç¹å®ããæã£ã±ãããå¼ã³é´ãé³´ããããã¯ããé®æã«è³ãããã§ãã
å ¬è¡ç¡ç·LAN使ã£ã¦ããã大ä¸å¤«ã§ãã£ã¦ï¼é²ç¯ã«ã¡ã©ã§è¿½ãã¾ãããã³ã·ã§ã³ã ã£ã¦è¿½ãã¥ããã ãã§çµå±ã¯è¿½ãã¾ãã
Winnyã ããããPerfectDarkã ããããTORã ããã追ãã¾ãã
ã©ããªäºãããã¨æ¥æ¬ã®è¦å¯ã¯ãã¤ãã追ãã¾ãã
ãããã ããããªãã¦ãæ®éã«ãã¡ãã¡ã«ã«ã¡ã©ãè¨ç½®ããã¦é²ç»ããã¦ãã¾ãããä»ããã©ã¬ã³ç©ãã§ããªãè»ã®æ¹ãå°ãªãã§ãã
ãããã®æ å ±å ¨ã¦ã使ããè¦å¯ã¯ç¯ç½ªãç¯ããããªãã追ãã¾ãã
人çãã´ãç®±ã«å©ãæ¨ã¦ãªãããã«ãããã©ã¤ãã·ã¼ãªãã¦ç¡ããã ããããã®æ°æã¡ã§è¡åããäºãä¸çªå¤§äºã§ãã
é®æãããã®ã¯æ å¼±ã®æ¥µã¿ã§ãã
æªã ã«æè³è©æ¬ºã«åãé£ä¸ã®æå³ãå ¨ãããããªã
ããã ãã®æ å ±ç¤¾ä¼ã§æªã ã«è³ã¿ãã«ç¥æµããã¾ããªã人éã£ã¦ä½ãªãã ãããªãã¨æãæ¨ä»ã§ãã
ãå¿ ãå²ããã¾ããï¼ã
ã¨æ¥ãã
ãããããã人ã«è¨ããªãæ¹ãè¯ãã§ããï¼èªåéã§ãã£ãããã£ããã©ãã§ããï¼ã
ã¨æããªãæå³ãããããªããã§ããã
ãã®èãæ¹ã§100%æè³è©æ¬ºãé¿ããããã§ããã©ãã»ã»ã»ã
ä¸ã®ä¸ã«ã¯å²ãã£ã¦ãå人äºæ¥ä¸»ãä¼æ¥ããããããã¾ããããã®æ®ã©ãå²ããæå£ã¯è¨ãã¾ããã
親åã«æãã¦ãããã競åãå¢ãããã«ãã¾ãããããããªã¢ãã¯ããããå²ããäºãªãã¦åºæ¥ãªãã§ãã
ã¾ããããèªæ ¢æ°ã«è©±ãä¼æ¥ããã¾ã«ã¯ãã¾ãããããã¯ç°¡åã«åºæ¥ãªãäºã ããããè¨ã£ã¦ããããã§ã
å²ãããªããããããä»äººã«ããããããã§ããã
ããå²ããã¨ãã¦ãèè² ããããªãã»ã©ãªã¹ãã¼ã ããããä»äººã«ããããããã§ãã
èªåéã§å¿ ãå²ããç¾å³ããé¨åã ãã¡ã ã¼ã¡ã ã¼ãã¦ãªã¹ãã¼ã ã£ããæããé¨åãä»äººã«ããããããã§ãã
ã¡ãã£ã¨ã¯è³¢ããªãã¾ããããã
CO2åæ¸ï¼ã¨ãè¨ã£ã¦ããéã«äººé¡ã¯æ» 亡ããã®ã§ã¯ï¼
ã¢ãã¿ããã«æãããªã£ããå¯ããªã£ãããç¹°ãè¿ããä½åº¦ãå£ç¯ã®å¤ããç®ãæ¥ããããã£ã¡ãã£ã¡ã§ç·ç¶é水帯ãçºçãã¦æ°´å®³ã»åç ç½å®³èµ·ãã£ããã
ä¿¡ããããªãåæ°ã®é·ãçºçããããæ²ç¸ã¨é森ã®æ°æ¸©ã30度ã¨åãã§ãé¢æ±ã39度è¶
ããå½ããåã«ãªã£ã¦ã¿ããã7æãããªã8æã©ããªããã ï¼ã£ã¦ãå¤é·ãããï¼ã¨æã£ã¦ã¿ããã
身è¿ã«çã£ãã¬ãã«ã®æ¸©æåãæãããæ¨ä»ããããéããã§ããããï¼
æã¯ç·ç¶é水帯ãªãã¦è¨èãããªãã£ããã§ããããã²ãªã©è±ªé¨ã£ã¦è¨èãåºã¦ããã¨æã£ããããã§ããã
ç¶æ³ã¯æªåã®ä¸éã辿ã£ã¦ãã¾ãããã人é¡ã®æ®ã©ããããè身ã«æãã¦ããã¯ãã§ãã
ä¸ç¯ã«ã¯ãæ°åå¤åã§åãè¿ãã®ã¤ããªãå亡ãããããã§ã«åãã¦ãã¾ã£ã¦ããã¨è¨ã説ãããã¾ãã
å°çç°å¢ã¯ç¹ãã£ã¦ããã®ã§æªãäºãé£éãã¦ãã¾ãã人é¡ã®æã«ãããªããªãæ´èµ°ç¶æ ã«ãªã£ã¦ãã¾ã£ã¦ããå¯è½æ§ãããã¨è¨ãäºã§ãã
ãããã温æåã®åå ãªãã¦æ»ã¬ã»ã©ããããã§ããããé£éãã¾ããã¾ãã
çãããç¥ã£ã¦ããäºé
¸åçç´ ããã®25åã®æ¸©å®¤å¹æãããã®ãã¡ã¿ã³ã
å°çã温æåããã¨ãå°ä¸ãæµ·åºã§åã£ã¦ããã¡ã¿ã³ã溶ãåºãã¦ãããã«æ¸©æåã
æ°æ¸©ãä¸ããã¨æµ·æ°´æ¸©åº¦ãä¸ããæ°´ã®è¸çºéãå¢ããã
空æ°ã¯æ¸©ããæ¹ãããããæ°´è¸æ°ãå«ãäºãåºæ¥ãã®ã§å
¨ä½çã«æ°´è¸æ°éãå¢ãã(ãããä¸çä¸ã§èµ·ãã£ã¦ãã大é¨ã®åå )ã
å®ã¯ãã®æ°´è¸æ°ã温室å¹æã®åå ã® 48% ã ã£ãããã(CO2㯠21%)ã
æ°æ¸©ãä¸ããããã ãããã¡ãã¡ã§å±±ç«äºçºçã
CO2ãå¸åãã森ãæ¶ããã©ãããCO2ãåãåºãã¦ãã¾ããçãã森ã復活ããã®ã«ã¯æ°åå¹´ãããã®ã§çããã°çããã»ã©æ¸ãä¸æ¹ã
ã©ãããã¢ããªå½å®¶ã¯çå
ãã¦æ£®ãçããã¦ããå§æ«ã
æµ·ã¯çµæ§ãªéã®CO2ãå¸åãã¦ãããã海水温ä¸æã§ãèããäºãåºæ¥ãCO2ãæ¸å°ãæ¾åºãã ãã
ã°ãªã¼ã³ã©ã³ããå極ãã®ä»ã©ãããã®æ°·ã溶ããæµ·é¢ä¸æããããã海水温ä¸æã§ç±è¨å¼µããã®ã§ããã§ãæµ·é¢ä¸æã
æµ·é¢ä¸æã«ããåå°ãæ¸ããå±±ãéæãæ´ã«æ£®ãæ¸ãã
ä½ãå ´æãè¾²å°ãæ¸ã£ã¦è¡ããé£ãç©ãæ¸ããä½ãå ´æããªããªãã¨äººé¡ããããã¨ã¯ä¸ã¤ã
ãæ¦äºãã
ããã人é¡ãåãåºãCO2ã ãæ¸ããã°ã©ãã«ããªãåé¡ã§ãããããï¼
ã¨è¨ããã人é¡ã¯ãä½åå¹´ CO2 æ¸ããï½ã¨è¨ã£ã¦ã¾ãï¼çµæã©ããªã£ã¦ã¾ãï¼
æ¸ããªãã§ããï¼ãããããæ¸ãã¾ãããããã£ã¨ã
ã¨è¨ããæ¸ãããã¨ããã§ãã®å¹æãåºãã®ã«æ°åå¹´ãããããæå³ãããã¨æããªããã
温æåã温æåãå¼ã¶å±éã§ããããã1ã¤ã®é£éãåãããããªãã¦ãä¸æã«ä½ç®æãé£éãåããªãã¨è©±ã«ãªããªãã
ãã¯ãã人é¡ãåãåºãCO2æ¸ãããï¼ãªãã¦æ é·ãªäºè¨ã£ã¦ããã§ã¼ãºã¯ã¨ã£ãã«çµãã£ã¦ããã§ãã
温æåãã¦ã洪水ã¯èµ·ããï¼ããåç å´©ãã¯ããï¼ããæµ·é¢ã¯ä¸æããï¼ããããåæã«ããåããå¿ è¦ãªãã§ãã
ãã£ãã治水ãè¦ç´ããªãã¨ãããªãããä½ããå ´æãå¶éããå¿ è¦ãããã®ãããããªããã
æµ·é¢ä¸æã«é¢ãã¦ã¯ãããªãæ·±å»ã ã¨æã£ã¦ãã¦ãæç ´ããã«ã¯æè¡é©æ°ãå¿ è¦ã«ãªã£ã¦ãã¾ãã
ä½ãããå¿ è¦ããããã¨è¨ãã¨ãå±±ã®ä¸ãããæãã¦å± ä½å°ãè¾²å°ãä½ãå¿ è¦ãããã¾ãã
æé¢ãã©ããããã¦ã£ã¦ã®ã¯åç å´©ãã®åé¡ãããããå±±ã®ä¸ã«ç©ºéãä½ãããæ¥æ¬ã«ã¯ç¸å½ä½åãªåå°ãçã¾ãã¾ãã
温æåã«å¯¾ãã¦ãå°ä¸ã¯æ¸©åº¦ãä½ãå®å®ãã¦ãã¾ããä¸ç³äºé³¥ã§ãã
æ¥æ¬ã®ãã³ãã«æåæè¡ã¯ä¸çã§ãå±æãªã®ã§ããããæ¡å¼µãã¦ãã£ã¨ã§ãã空éãä½ããæè¡ãéçºããã°è¯ãã®ã§ãã
ããããä¸çä¸ã§å¿ è¦ã«ãªã£ã¦ããæè¡ã§ããããã®æè¡ã¨éå ·ã®è¼¸åºã ãã§å½ã¨ãã¦ãããªãå²ããã¯ãã§ãã
å¾ã¯æµ·ãå¢ãããã ãããæ¼æ¥ã¯å å®ããã ããã£ã¦äºã§ããã£ã¡ã¸çç£æ¥ãã·ãããã¦è¡ãã¨ãã§ããã
ã¾ãã対å¦çæ³ã§ããããããããªãããããªãããªãã¨ã
æ ¹æ¬çãªæ²»çæ³ãç¡ãã¨ãè¨ããªããã§ããã©ããå®å®ç©ºéã«åãåºãã¦å¤ªé½å ãã³ã³ããã¼ã«ãã¦ãã¾ãæ¹æ³ãããã¾ãã
ãã ãããã誰ãã©ã責任ãåããã ï¼ã¨è¨ãã¨ãããããã¯ã«ãªã£ã¦å®ç¾ã¯ä¸å¯è½ã§ããã©ãã
大åã®å½å®¶ãããã®ã·ã¹ãã ã§å©ãã£ãã¨ãã¦ããå²ãé£ãå½å®¶ãåºã¦ãã¦å¿ ãã®ã£ã¼ã®ã£ã¼æå¥ãè¨ãã®ã§ã
å ¨å½å®¶ã«è¨±å¯åããªãã¦100ï¼ ç¡çã§ããã
å®ç¾ããããã«ã¯ãä¸çã§å ¨é¢æ¦äºãã¦çµ±ä¸å½å®¶ä½ãããç¡ãã§ããããã
ã¨è¨ãããã§ããããã人é¡ã¯ç¾å®ãã¡ããã¨è¦ãã¹ãã ã¨æãã¾ããã¨ãã
SvelteKit ã®ä½¿ãæ¹ããããããã解説ãã¦ã¿ã - Svelte Vol.2
æé»ã®ä¸ç
SvelteKit ã¯è³ã¿ããå°ããé£ä¸ãå«ãæé»ã®ã«ã¼ã«ã§æº¢ãè¿ã£ã¦ãã
ãªã®ã§ãããè¨ãã®ãå«ããªã絶対ã«ä½¿ãã¹ããã
éã«æé»ã好ããªãæé«ã®ä½¿ç¨æãå¾ãããã¯ãã
åºæ¬çã«åä¸é層ã«ãã¡ã¤ã«ãä½ãã ãã§æé»ã®ç¶æ¿ããã³ãã³è¡ãããããã
åºæ¬ã®ãã¡ã¤ã«
src/routes/ 以ä¸ã« +page.svelte ãç½®ãã ã㧠/ ã§ã¢ã¯ã»ã¹å¯è½ã«ãªã
src/routes/hoge/ 以ä¸ã«ç½®ãã° /hoge ã§ã¢ã¯ã»ã¹å¯è½
+page.svelte
ããã¤ããã¢
ãµã³ãã«ãä¸è¨ãã¦ã¿ã
<script> console.log('TOP +page.svelte') export let data </script> <template lang="pug"> h2 TOP pre {JSON.stringify(data, null, 2)} </template>
ãã¼ã·ã³ãã«ï¼
export let data
ä½ããããã¤ã¨æã£ã人ã¯æ£å¸¸ï¼
ãªããããããåºããããããï¼ä½ãã©ãã«åºãã®ï¼ã£ã¦æããããï¼ï¼
éããã ãªã³ã¬ã
+ã§å§ã¾ããã¡ã¤ã«åãããæ¿ãã¢ã»ã³ã¹ãªãã ããããã
+page.js ã¨ã +page.server.js ãã export ããããã¼ã¿ãæé»ã§ import ãã¦ãã ãªãããã»ã»ã»ï½·ï¾ï½¯
ããä½ããï¼ã¢ã©ãã®ç³æ²¹çã飼ã£ã¦ããã³ãã³ã¸ã¼ãä½ã£ãã®ï¼
ã³ã¬ããã¢ãã¨æããªããã¤ã¨åã空æ°å¸ãããç¡ãã¬ãã«ã§é
·ãå®è£
ãªã®ã¯ã°ãã¨ææ
¢ã (ãã®ãã¡ç ´å£çå¤æ´å
¥ããï½)
+page.js
ãã©ã¦ã¶å´ã§ +page.svelte ã«ãã¼ã¿ãæ³¨å ¥ãã
console.log('TOP +page.js') export function load() { console.log('TOP +page.js LOAD') return { top: 'TOP' } }
load() ã§å¤ãè¿ãã¨ãããã¤ãæ¿ãã¢ãªããã¤ã§åãåããã¨è¨ã寸æ³
Svelte 使ã£ã¦ããã©è¯ãæããã§ãããã¥ã¡ã³ããå¾®å¦éãã¦çµãã£ã¦ã - Svelte Vol.1
表é¡ã®éããå
¬å¼ãµã¤ãã¯å¾¡è¨ã ããã§èªã¿ã¥ãããããã¦æ
å ±ãè²ã
足ããªã
è²ã
è¦å´ããã®ã§ã¡ã¢ãã¦ãã«çã«å
±æ
(â» ããã¾ã§å人ã¦ã¼ã¹ã§éã³ã§ä½¿ã£ã¦ããéãã¯ã¤ã±ã¦ããæã
ãããæ¬æ ¼çãªããã¸ã§ã¯ãã«ã¶ã£ããã§è¦æ¨¡ã®ãã«ããã®ãéçºããæ
React ã¿ãããªæ²æ¨ãªãã¨ã«ãªãããã©ããã¯ã¾ã 解ãã)
SvelteKit
ããã¸ã§ã¯ãèµ·ããã«ã¯ã³ã¤ããVue ã¿ããã« CDN ããèªãã§ã¡ããã£ã¨è©¦ãã¨ãã¯åºæ¥ç¡ã
ããã¸ã§ã¯ãä½æ & éçºãµã¼ãèµ·å
npm create svelte@latest test cd test npm i npm run dev
Skeleton project
Type Script ãªããæéã®ä½ã£ã¦ããç¥ã£ããã¶ãã¯ã½ Noob 以å¤ã¯ä½¿ããªãã¦è¯ã
ãã®ä»ãè¦ãã
訳ã®ãããããã¼ãã§ç«ã¡ä¸ããã®ã§ 8080 ã§èµ·åã localhost 以å¤ããã¢ã¯ã»ã¹ããã
npm run dev --host 0.0.0.0 --port 8080
ã¯ã½ããã©ãã®ã§ãpackage.json ã«ä»¥ä¸ã追å
"s": "vite dev --host 0.0.0.0 --port 8080",
ããã«ãã«ããã©ãã®ã§ãyarn ã§å©ã
ããã« zshrc ã« alias ã追å
alias y='yarn'
y s
ã¨ã·
alias nr='npm run'
ããªã¹ã¹ã¡ããã
Pug & SCSS
HTML ã¨ããã¬ã¤ã³ããããªãã«ã®æ¸ããã®
CSS ããã«ãççº
SvelteKit ã¯ãµã¯ã㨠Pug 㨠SCSS ããµãã¼ããã¦ãããï¼æé«ï¼ï¼
ã¨ã³ãã¬ã§éå ±ãããã¨ã åçãã¬ã¼ãå¹ãã¾ãã EV è»ã©ãããã ï¼
ã¨ã³ãã¬ã¯çè²»åä¸ãããããã¬ã¼ãã®æ©èã軽æ¸åºæ¥ãããæç¿æã§ãåéãä¸ãå ´åã¯ãã§ã¼ãç¾è±¡ããã¼ãã¼ããã¯ç¾è±¡ãé¿ããããã«ã¨ã³ãã¬ä½¿ãã¨æããããããã§ã¡ãªããããç¡ã代ç©ã¨è¨ãã®ã大åã®é転è
ã®èªèã ããã¨æãã
ããã¥ã¢ã«ãªãã¦åæ¢æã«ã¯å½ããåã®ããã«ã®ã¢ãã¦ã³ãã¦ã¨ã³ãã¬ããã¾ããããã
ããã§éå ±ãããã¨ã¯ããã¾ã£ããããããªãããªã
以åãEV è»ã«ä¹ã£ãæã¢ã¯ã»ã«ãã足ãé¢ããæã®æ¥æ¿ãªæ¸éã«é©ããããã¬ã¼ããã足ãé¢ããã ã㧠1 éã¨ã L ã«å ¥ãããããã®ã¨ã³ãã¬ããããã
ããã¤ã¯åçãã¬ã¼ãã£ã¤ã£ã¦ã¢ã¼ã¿ã¼ããã¤ãã¢ç¶æ ã«ãªã£ã¦çºé»ãè¡ããããã®è² è·ã§æ¸éããã¨è¨ããã®ã
ä¹ã£ãè»ã¯ãã¬ã½ãªã³ã§çºé»æ©ãåãã¦çºé»ãã¦ãã®é»åã使ã£ã¦ã¢ã¼ã¿ã¼ãåããã¨è¨ããã©ãèãã¦ãå
çæ©é¢ã§çããã¦ç´æ¥ååã«ããæ¹ãè¯ãã ãã
ã¨æããä½ã¨ãé ã®æªãã¦ç±å¹çã®æªãããªä»£ç©ãªãã ãã絶ææãå³ãã鬱é¶ããå
é»ãç¡ãã
æ°æ¸©ã¨å
±ã«å£åããããããªã¼ã®ã¯ã½ãå æ¸ãç¡ãã¾ãã§ã¬ã½ãªã³è»ã®ãããªä½¿ç¨æ㧠EV ã®ãã¯ã¼ãååã«å³ããã代ç©ã§
ãè¯ããããï¼ãã¨æã£ãæ°ç§å¾ã«ããããã EV ã£ã¦åç³çæè±å´ã®ããã®ããã ãï¼ä½ã®ããã«åå¨ãã¨ããããã®è»ï¼ï¼ãã¨æã£ãããã ãã
ããã¾ã§ä»ã¯ EV é»ææã§æ··ä¹±ãã¦ããã ãã§ãã£ã¦ãEV ãå¾ã
ã«å¢ãã¦è¡ãã®ã¯é¿ããããªãéãªããã§(æµè¡ãã¨ã¯å
¨ãæã£ã¦ããªã)ã
ã¨ã³ãã¬åé¡ã£ã¦ããããå
ã大äºã«ãªãããããï¼ã¨æã£ããã ãã調ã¹ããã©ããåçãã¬ã¼ãçºåæã«ã¯ãã¬ã¼ãã©ã³ããç¹ç¯ãããããã
ãªãã ãç´ æ´ããããããã
ãªã¼ããã¨ããã¥ã¢ã«ã¯æªã ã«ãã®ä»çµã¯ç¡ãããããã¾ãçºé»æã«ããç¨åº¦ã®é»æµãæµãããç¹ç¯ãããã¿ãããªåè·¯ã£ã¦ããçµã¿è¾¼ãããã ãã©ãããã¥ã¢ã«ã¨ããªã¼ããã¨ãã¯ç¢ºãã«å³ãããã
ãªã®ã§ãEV ã«ä¹ã£ããå©ããã®ãï¼
ãããã»ã»ã»ä¿ºã¯ãã¬ã¼ãã©ã³ããç¹ç¯ããã¾ãããã¤ã®æ¹ãå±ãªããã¤ã ã¨æã£ã¡ãããã ããªãã
ãããã¤å±ãªã£ã»ã»ã»ã¢ãã ãã»ã»ã»è»éè·é¢éããã»ã»ã»ãã¨é¢ããã追ãæãããªã追ãæããé転ãä¸æã ã¨å¤æãã¡ãããã ããªãã
ã¨ã³ãã¬ã§æ¸éãããã¤ã®æ¹ã絶対çãªå®å¿æãããã
ããè¨ããã©ã¤ãã¼ãã»ã¨ãã©ã ã¨æã£ã¦ãããã ãã人ã«ãã£ã¦ã¯ããã§ãç¡ããããã
ãããªäºã§éå ±ãããã¤ããããã ã£ã¦æèãã¤ã¤ã¨ã³ãã¬ä½¿ã£ã¦ãããã¨ãªããã¨æãã¾ããã¨ãã