๐™œ๐™ž๐™ฉ ๐™ง๐™š๐™ฅ๐™ค๐™จ๐™ž๐™ฉ๐™ค๐™ง๐™ฎ ๐™ข๐™ž๐™ง๐™ง๐™ค๐™ง๐™ž๐™ฃ๐™œ

uuuouuoยท2022๋…„ 6์›” 13์ผ
0
post-thumbnail

๐Ÿ“ Git repository commit log ์œ ์ง€ํ•˜๋ฉฐ ์ด๋™


โœ” Repository A โžก Repository B

  1. A clone ๋ฐ›๊ธฐ
git clone --bare [A repository์ฃผ์†Œ]
  1. .git ํด๋”๋กœ ์ด๋™
cd [A ํด๋”]

# ์˜ˆ์‹œ
cd A.git
  1. B๋กœ push
git push --mirror [B repository์ฃผ์†Œ]

โœ” 100MB ์ดˆ๊ณผํ•˜๋Š” ํŒŒ์ผ์ด ์žˆ๋Š” ๊ฒฝ์šฐ

  1. A clone ๋ฐ›๊ธฐ
git clone --bare [A repository์ฃผ์†Œ]
  1. BFG RepCleaner๋‹ค์šด๋ฐ›์•„ .git ํด๋”์™€ ๊ฐ™์€ ๊ฒฝ๋กœ์— .jarํŒŒ์ผ ๋„ฃ๊ธฐ

  2. A.git ํด๋”์—์„œ 100MB ๋„˜๋Š” ํŒŒ์ผ ์ œ๊ฑฐ

java -jar [bfg ๋ฒ„์ „์— ๋”ฐ๋ผ].jar --strip-blobs-bigger-than 100M [A ํด๋”]

# ์˜ˆ์‹œ
java -jar bfg-1.14.0.jar --strip-blobs-bigger-than 100M A.git
  1. .git ํด๋”๋กœ ์ด๋™ ํ›„ ์‹ค์ œ๋กœ ์‚ญ์ œ
cd [A.git]
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push # pushํ•˜๋ฉด ๋ณ€๊ฒฝ๋œ ์ƒํƒœ๋ฅผ remote repository์—๋„ ์—…๋ฐ์ดํŠธ
  1. B๋กœ ์˜ฎ๊ธฐ๊ธฐ
git set-url remote origin [B repository์ฃผ์†Œ]

0๊ฐœ์˜ ๋Œ“๊ธ€