×ðÁú¿­Ê±

gitÔõôɾ³ýÀúÊ·¼Í¼

gitÊÇÏÖÔÚ×îÊ¢Ðеİ汾¿ØÖÆϵͳ֮һ¡£È»¶ø £¬ÓÐʱ¼äÎÒÃÇ¿ÉÄÜÐèҪɾ³ýgitÏîÄ¿ÖеÄÀúÊ·¼Í¼ £¬ÒÔ±ãÖØÐÂ×îÏÈ¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃgitÏÂÁîºÍ¹¤¾ßÀ´É¾³ýgitÏîÄ¿ÖеÄÀúÊ·¼Í¼¡£

ʹÓÃgit resetÏÂÁîɾ³ýÀúÊ·¼Í¼

Git resetÏÂÁî¿ÉÓÃÓÚ×÷·ÏÌá½»²¢É¾³ýÀúÊ·¼Í¼¡£Õâ¸öÏÂÁÔÚHEADÖ¸Õë֮ǰµõÏúÒ»¸ö»ò¶à¸öÌá½» £¬²¢½«Ö¸ÕëÒƶ¯µ½Ö¸¶¨µÄÌá½»¡£

Ҫɾ³ýGitÏîÄ¿µÄÀúÊ·¼Í¼ £¬ÄãÐèҪʹÓÃgit resetÏÂÁî £¬²¢½«Ö¸ÕëÒƶ¯µ½Ò»¸öÔçÆÚµÄÌá½»¡£Õ⽫µ¼ÖÂÔÚÖ¸ÕëÇ°µÄËùÓÐÌá½»±»µõÏú²¢´ÓÀúÊ·¼Í¼ÖÐɾ³ý¡£Äã¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ

git reset --hard <commit-id></commit-id>

µÇ¼ºó¸´ÖÆ

ÔÚÕâ¸öÏÂÁîÖÐ £¬¡° ¡±ÊÇGitÏîÄ¿ÖÐÔçÆÚÌá½»µÄ¹þÏ£Öµ¡£Ê¹ÓôËÏÂÁîºó £¬GitÏîÄ¿½«»Øµ½Ö®Ç°µÄÌύ״̬ £¬²¢É¾³ýÖ¸Õë֮ǰµÄËùÓÐÌá½»¡£

Çë×¢ÖØ £¬Ê¹ÓôËÏÂÁîºó £¬ÄúÎÞ·¨»Ø¸´ÒÑɾ³ýµÄÀúÊ·¼Í¼¡£Òò´Ë £¬´ËÏÂÁîÓ¦ÉóÉ÷ʹÓà £¬½öÓÃÓÚ²»ÐèÒª±£´æÀúÊ·¼Í¼µÄÇéÐÎÏ¡£

ʹÓÃgit filter-branchÏÂÁîɾ³ýÀúÊ·¼Í¼

ÁíÒ»ÖÖͨ¹ýGitɾ³ýÀúÊ·¼Í¼µÄÒªÁìÊÇʹÓÃgit filter-branchÏÂÁî¡£Õâ¸öÏÂÁî¿ÉÒÔÓÃÀ´ÖØдGitÏîÄ¿µÄÀúÊ·¼Í¼ £¬°üÀ¨ÖØдÌá½»ÐÂÎÅ¡¢É¾³ýÌá½»¡¢²ð·Ö±£´æµÄÌá½»µÈ¡£

Ҫɾ³ýGitÏîÄ¿µÄÀúÊ·¼Í¼ £¬ÄúÐèҪʹÓÃÒÔÏÂÏÂÁ

git filter-branch --force --tree-filter 'rm -rf path/to/your/file/or/directory' HEAD

µÇ¼ºó¸´ÖÆ

ÔÚÕâ¸öÏÂÁîÖÐ £¬¡°path/to/your/file/or/directory¡±ÊÇҪɾ³ýµÄÎļþ»òĿ¼Ãû³Æ¡£Ê¹ÓôËÏÂÁîºó £¬Git½«±éÀúÕû¸öÀúÊ·¼Í¼ £¬²¢É¾³ýÖ¸¶¨Îļþ»òĿ¼ÖеÄËùÓÐÄÚÈÝ¡£

Çë×¢ÖØ £¬Ê¹ÓôËÏÂÁî¿ÉÄÜ»áÓ°ÏìGitÏîÄ¿µÄÕûÌåÐÔÄÜ¡£±ðµÄ £¬Óëgit resetÏÂÁîÒ»Ñù £¬Ê¹ÓôËÏÂÁîºó £¬ÄúÎÞ·¨»Ö¸´ÒÑɾ³ýµÄÀúÊ·¼Í¼¡£

ʹÓÃBFG Repo-Cleaner¹¤¾ßɾ³ýÀúÊ·¼Í¼

BFG Repo-CleanerÊÇÒ»¸öרÃÅÓÃÓÚɾ³ýGitÏîÄ¿ÀúÊ·¼Í¼µÄ¹¤¾ß¡£´Ë¹¤¾ßÊÇÒ»¸öJava¿â £¬¿ÉÓÃÓÚÕûÀí´óÐÍGitÌá½»µÄÀúÊ·¼Í¼ £¬Ê¹Æä¸ü¾ß¿ÉÖÎÀíÐÔ¡£

ҪʹÓÃBFG Repo-Cleanerɾ³ýGitÏîÄ¿µÄÀúÊ·¼Í¼ £¬Çëƾ֤ÒÔÏ°취²Ù×÷£º

ÏÂÔØBFG Repo-Cleaner £¬½âѹËõ²¢×°ÖÃ

ÔÚÖÕ¶ËÖе¼º½µ½ÒªÕûÀíµÄGitÏîÄ¿ËùÔÚµÄĿ¼ £¬²¢Ö´ÐÐÒÔÏÂÏÂÁ

java -jar bfg.jar --delete-files <file-to-delete> --delete-folders <folder-to-delete> <your-repo.git></your-repo.git></folder-to-delete></file-to-delete>

µÇ¼ºó¸´ÖÆ

ÔÚÕâ¸öÏÂÁîÖÐ £¬¡° ¡±ÊÇҪɾ³ýµÄÎļþÃû³Æ £¬¡° ¡±ÊÇҪɾ³ýµÄÎļþ¼ÐÃû³Æ £¬¡° ¡±ÊÇGitÏîÄ¿µÄ·¾¶¡£

ʹÓôËÏÂÁîºó £¬BFG Repo-Cleaner½«±éÀúÕû¸öÀúÊ·¼Í¼ £¬²¢É¾³ýÖ¸¶¨Îļþ»òÎļþ¼ÐÖеÄËùÓÐÄÚÈÝ¡£

Çë×¢ÖØ £¬ÔÚʹÓÃBFG Repo-Cleaner֮ǰ £¬ÄúÓ¦¸Ã±¸·ÝÕû¸öGitÏîÄ¿ £¬ÒÔ×èÖ¹²»ÐëÒªµÄÊý¾Ýɥʧ¡£

½áÂÛ

ÔÚ±¾ÎÄÖÐ £¬ÎÒÃÇÏÈÈÝÁËÈýÖÖ²î±ðµÄÒªÁìÀ´É¾³ýGitÏîÄ¿ÖеÄÀúÊ·¼Í¼£ºÊ¹ÓÃgit reset¡¢git filter-branchÏÂÁîºÍBFG Repo-Cleaner¹¤¾ß¡£Çë×¢ÖØ £¬ÔÚʹÓÃÕâЩҪÁì֮ǰ £¬ÄúÓ¦¸Ã±¸·ÝÕû¸öGitÏîÄ¿ £¬ÒÔ×èÖ¹Êý¾Ýɥʧ¡£Í¨¹ý׼ȷµØɾ³ýÀúÊ·¼Í¼ £¬Äú¿ÉÒÔÔÚ²»Ó°Ïì°æ±¾¿ØÖƵÄÇéÐÎÏÂÖØÐÂ×îÏÈGitÏîÄ¿¡£

ÒÔÉϾÍÊÇgitÔõôɾ³ýÀúÊ·¼Í¼µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

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

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

QR code
¡¾ÍøÕ¾µØͼ¡¿¡¾sitemap¡¿