×ðÁú¿­Ê±¹ÙÍøµÇ¼

ÁÄÁÄgitÉÑþ³ØýÌí¼ÓÎļþµÄÒªÁì

ÔÚʹÓÃgitÖÎÀíÏîĿʱ£¬ÎÒÃÇÐèÒªÒ»Ö±µÄÌí¼ÓÎļþºÍÎļþ¼Ðµ½°æ±¾¿âÖУ¬¾ÙÐа汾¿ØÖƺÍЭ×÷¿ª·¢¡£¿ÉÊÇ£¬ÓÐʱ¼äÎÒÃÇ¿ÉÄÜÌí¼ÓÁ˹ýʧµÄÎļþ»òÕß²»ÐèÒªµÄÎļþ£¬Õâ¸öʱ¼ä¾ÍÐèÒª½«Æä´Ó°æ±¾¿âÖÐɾ³ý¡£±¾ÎĽ«ÏêϸÏÈÈÝgitɾ³ýÌí¼ÓµÄÎļþµÄÒªÁì¡£

Éó²égit״̬

ÔÚɾ³ýÎļþ֮ǰ£¬ÎÒÃÇÐèÒªÏÈÉó²égit״̬£¬È·¶¨ÐèҪɾ³ýµÄÎļþÊÇ·ñÒѾ­Ìá½»µ½°æ±¾¿âÖС£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÉó²égit״̬£º

$ git status

µÇ¼ºó¸´ÖÆ

ÈôÊÇgit״̬ÖаüÀ¨ÐèҪɾ³ýµÄÎļþ£¬ÄÇô¿ÉÒÔ¼ÌÐø¾ÙÐкóÐøµÄɾ³ý²Ù×÷¡£

ɾ³ýµ¥¸öÎļþ

ÈôÊÇÐèҪɾ³ýµ¥¸öÎļþ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

$ git rm [file]

µÇ¼ºó¸´ÖÆ

ÆäÖÐ[file]ÌåÏÖÐèҪɾ³ýµÄÎļþÃû¡£Ö´ÐиÃÏÂÁîºó£¬git»á½«Îļþ´Ó°æ±¾¿âÖÐɾ³ý£¬²¢½«É¾³ý²Ù×÷Ìí¼Óµ½ÔÝ´æÇø¡£´Ëʱ£¬ÐèҪʹÓÃÒÔÏÂÏÂÁÐÞ¸ÄÌá½»µ½°æ±¾¿â£º

$ git commit -m "delete file"

µÇ¼ºó¸´ÖÆ

×¢ÖØ£¬ÈôÊÇÐèÒª×÷·Ïɾ³ý²Ù×÷£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

$ git restore [file]

µÇ¼ºó¸´ÖÆ

ÆäÖÐ[file]ÌåÏÖÐèÒª»Ö¸´µÄÎļþÃû¡£

ɾ³ýÎļþ¼Ð

ÈôÊÇÐèҪɾ³ýÕû¸öÎļþ¼Ð£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

$ git rm -r [folder]

µÇ¼ºó¸´ÖÆ

ÆäÖÐ[folder]ÌåÏÖÐèҪɾ³ýµÄÎļþ¼ÐÃû¡£Ö´ÐиÃÏÂÁîºó£¬git»á½«Îļþ¼Ð¼°Æä°üÀ¨µÄËùÓÐÎļþ´Ó°æ±¾¿âÖÐɾ³ý£¬²¢½«É¾³ý²Ù×÷Ìí¼Óµ½ÔÝ´æÇø¡£Í¬ÑùÐèҪʹÓÃÒÔÏÂÏÂÁÐÞ¸ÄÌá½»µ½°æ±¾¿â£º

$ git commit -m "delete folder"

µÇ¼ºó¸´ÖÆ

ÈôÊÇÐèÒª×÷·Ïɾ³ýÎļþ¼Ð²Ù×÷£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

$ git restore [folder]

µÇ¼ºó¸´ÖÆ

ÆäÖÐ[folder]ÌåÏÖÐèÒª»Ö¸´µÄÎļþ¼ÐÃû¡£

»Ö¸´ÒѾ­É¾³ýµÄÎļþ

ÈôÊÇÐèÒª»Ö¸´ÒѾ­É¾³ýµÄÎļþ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

$ git checkout [commitID] -- [file]

µÇ¼ºó¸´ÖÆ

ÆäÖÐ[commitID]ÌåÏÖÐèÒª»Ö¸´µÄcommit ID£¬[file]ÌåÏÖÐèÒª»Ö¸´µÄÎļþ¡£Ö´ÐиÃÏÂÁîºó£¬git»á½«Îļþ»Ö¸´µ½Ö¸¶¨µÄcommit ID°æ±¾ÖС£

ɾ´íÇéÐδ¦Àí

ÔÚʹÓÃgitɾ³ýÎļþµÄÀú³ÌÖУ¬ÓÐЩÇéÐÎÏ¿ÉÄÜ»áɾ³ýÁ˲»Ó¦¸Ãɾ³ýµÄÎļþ»òÎļþ¼Ð£¬Ôì³É²»ÐëÒªµÄËðʧ¡£Õâʱ£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÒÔÏÂÒªÁì¾ÙÐд¦Àí£º

ÖØÐÂÌí¼Ó±»ÎóɾµÄÎļþ»òÎļþ¼Ð

»Ö¸´ÒѾ­É¾³ýµÄcommit ID°æ±¾

ÈôÊÇÊǶÔÒѾ­Ìá½»µÄÎļþ¾ÙÐÐÎóɾ£¬ÄÇôÐèÒªÖ±½Ó»Ö¸´ÒѾ­Ìá½»µÄcommit ID°æ±¾¡£ÈôÊÇÎóɾµÄÎļþ²¢Ã»ÓÐÌá½»µ½°æ±¾¿âÖУ¬¿ÉÒÔͨ¹ýÖØÐÂÌí¼ÓÀ´µ÷½â¡£

×ܽá

gitÊÇÏÖÔÚ×îΪʢÐеİ汾¿ØÖƹ¤¾ßÖ®Ò»£¬Í¨¹ýgit¿ÉÒÔÀû±ãµÄ½«ÎļþºÍÎļþ¼ÐÌí¼Óµ½°æ±¾¿âÖоÙÐа汾¿ØÖƺÍЭ×÷¿ª·¢¡£¿ÉÊÇ£¬ÔÚʹÓÃgitµÄÀú³ÌÖУ¬Ò²ÐèҪעÖØɾ³ý²Ù×÷µÄ¾«×¼ÐÔ£¬×èÖ¹ÎóɾºÍÊý¾ÝËðʧ¡£±¾ÎÄÏÈÈÝÁËgitɾ³ýÌí¼ÓµÄÎļþµÄÒªÁ죬ϣÍû¿ÉÒÔ×ÊÖú¸÷È˸üºÃµØʹÓÃgit¾ÙÐпª·¢ºÍÖÎÀí¡£

ÒÔÉϾÍÊÇÁÄÁÄgitÉÑþ³ØýÌí¼ÓÎļþµÄÒªÁìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ