๐ํ๋ก๊ทธ๋๋ฐ
[์ ๋ณด] git commit ๋ด์ญ ์ ๋ฆฌํ๊ธฐ
TwoIceFish
2023. 9. 4. 22:01
ํ์ค์์ฝ
๋ธ๋์น๋ฅผ ๊ณ ์๋ก ๋ง๋ค์ด๋ผ ๊ทธ๋ฆฌ๊ณ ์๋ก์ด ๊ณณ์ ๋ฎ์ด์จ๋ผ
ํ๋์ ๋ธ๋์น๋ฅผ ๊ณ ์๋ก ๋ง๋ค๊ณ ๊ฑฐ๊ธฐ์ ์ต์ด ์ปค๋ฐํ๊ณ origin์ ๋ฎ์ด ์์ฐ๋ ๊ฒ์ด๋ค.
protected branch๋ผ๋ฉด ํด์ ํด์ผ ํธ์๋๋ค.
git checkout --orphan latest_branch
git add -A
git commit -am "Initial commit message" #Committing the changes
git branch -D master #Deleting master branch
git branch -m master #renaming branch as master
git push -f origin master #pushes to master branch
git gc --aggressive --prune=all # remove the old files
์ฐธ๊ณ ๋ด์ฉ
orphan
https://www.linkedin.com/pulse/how-remove-git-commit-history-nitin-raturi/
commit ๋ด์ญ์ ์ ๋ฆฌํ๋ ์ข์๋ฐฉ๋ฒ: squash
Git squash๋ก ์ฌ๋ฌ ์ปค๋ฐ์ ํ๋๋ก ๋ง๋ค๊ธฐ
Git squash๋ฅผ ์ฌ์ฉํ์ฌ ์ฌ๋ฌ ์ปค๋ฐ์ ํ๋์ ์ปค๋ฐ์ผ๋ก ๋ง๋๋ ๋ฐฉ๋ฒ์ ๋ํด์ ์์๋ด ๋๋ค.
deku.posstree.com