Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
翻訳å : Oh shit, git! gitã¯ä½¿ãã«ããï¼ Gitã¯é£ãã: ä¸èº«ãç ´å£ã«ããã®ã¯ç°¡åãªã®ã«ãéå»ã®éã¡ãä¿®æ£ããæ¹æ³ãè¦ã¤ããã®ã¯æ¥µãã¦å°é£ã ãããã¥ã¡ã³ãã«ã¯ä¿®æ£ããã³ãã³ãåãæ¸ããã¦ãã¦ãããã®ååãç¥ããªããã°ä½¿ããã®ã«ãªããªããããã¯ãé¶ãå ããåµãå ããã¨ããã¸ã¬ã³ããæ±ãã¦ããï¼ ã ããç§ãé¥ã£ãæ°ã ã®åé¡ãããã«ãã¦æãåºãããæ¸ããã ãªãã¦äºã ï¼ç§ã¯å¤§å¤ãªèª¤ã¡ãç¯ããï¼ã¿ã¤ã ãã·ã³ãå¼ã³åºãã«ã¯ã©ãããã°ããï¼ï¼ git reflog # you will see a list of every thing you've done in git, across all branches! # each one has an index HEAD@{index} # find the one before you broke everything git
Protected branches and required status checks ãããæ¸ã¿ã§ããï¼ï¼ 9æ4æ¥ã®ãã¨ã§ããgithubãã以ä¸ã®æ©è½ããªãªã¼ã¹ããã¦ãã¾ãã ç¹å®ãã©ã³ãã¸ã®force pushãç¡å¹ãã ç¹å®ãã©ã³ãã¸ã®ãã¼ã¸æã«ã¹ãã¼ã¿ã¹ãã§ãã¯ãå¿ é ã«ãã(CIã¨é£æºãã¦ããå ´åã¯ããã¹ããéãã¾ã§ãã¼ã¸ã§ããªãããã«ã§ãã) ãããå®æ½ãããã¨ã§ãããæ¥æ°äººãè¬ã®ç©ºã®ã³ããããmasterãã©ã³ãã«force pushãã¦æ¥ãããããæ¥éä¸ããJOINãã人ãpull reqãããã«developãã©ã³ãã«è¬ã³ããããforce pushãã¦æ¥ãããããæ¥ã¨ããOSSã§ééãã¦ä¸ã¶æåã®ãã¼ã«ã«ã¬ãã¸ããªãgit push --forceãã¦ãã¾ããªãã¦ãã¨ããªããªããã§ãï¼ï¼ï¼(githubã使ã£ã¦ããã°) ããªãã®é£ã®ã¨ã³ã¸ãã¢ãããããªãçºçãã¦å£
Gitã§ãããããæã«ä½¿ãã19åã®å¥¥ç¾©ãæ¸ãã¦ãããããã¨ãã«ãªãã¨ããªã«ããªã§ããããã«ããã ä»åã¯ããããããããããªãããã«ãããããã£ã¦ããã話ã ã³ãããç·¨ .gitignoreãç´°ããæå®ãã¦ãã .gitignoreãæå®ãã¦ããã°ä½è¨ãªãã¡ã¤ã«ãã³ããããã¡ãããã¨ãäºé²ã§ãã¾ã éå»ã«ä¼¼ããããªããã¸ã§ã¯ããããã®ãªããããæµç¨ãã¾ãããã ãªãã®ã§ããã°.gitignore.ioã§çæãã¦ãããã«ã¹ã¿ã ãã¾ãããã ã¯ã¤ã«ãã«ã¼ãæå®ããã£ã¬ã¯ããªã¾ããã¨ã®æå®ã¯å¯ä½ç¨ããå¯è½æ§ãããã®ã§æ éã«ã ã³ãããã¡ãã»ã¼ã¸ã®ãã©ã¼ãããã決ãã¦ãã ã³ãããã¡ãã»ã¼ã¸ã®ãã©ã¼ãããã決ãã¦ããã°æ¸ãç´ãããã¨ãããã¨ãæ¸ãã¾ã ã³ãããã¡ãã»ã¼ã¸ãããããã¦ç´ãããã¨æããã¨ã¯ããããã¾ãã ããããã®ã£ã¦æ¡å¤ã³ãããã¡ãã»ã¼ã¸ãèªç±ããããã¨ãåé¡ã ã£ãããã¾ãã ãã
ã¢ãã & ã³ããã å¤æ´ããããã¡ã¤ã«ãé¸æãã¾ãã git add <filename> git add * ãå®è¡ããã¨Indexã«è¿½å ããã¾ãã ããã¯åºæ¬çãªä½æ¥ã®ä¸ã¤ã§ãã å¤æ´ãå®éã«é©ç¨ããã«ã¯ git commit -m "Commit message" ãå®è¡ãã¾ãã å¤æ´ãHEADã«å ¥ãã¾ãããã ãªã¢ã¼ããªãã¸ããªã«ã¯æªã å ¥ã£ã¦ãã¾ããã å¤æ´ã®ããã·ã¥ ãã®æç¹ã§ãå¤æ´ããã¼ã«ã«ãªãã¸ããªã®HEADã«é©ç¨ããã¾ããããã®å¤æ´ããªã¢ã¼ããªãã¸ããªã«é©ç¨ããã«ã¯ git push origin master ãå®è¡ããmasterã®ä»£ããã«é©ç¨ã®ãã©ã³ãåãå ¥ãã¾ãã ããæ¢åãªãã¸ããªãã¯ãã¼ã³ããã«ä½¿ç¨ããå ´å git remote add origin <server> ãå®è¡ããã¨ããªã¢ã¼ããªãã¸ããªãç»é²ããäºãå¯è½ã§ãã ããã§å¤æ´ãç¹å®ãªãªã¢ã¼ããªãã¸ã
ãç¥ãã
é害
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}