# global
git config --global user.name
git config --global user.email
git config user.name
git config user.email
# ๋ก๊ทธ ํ์ธ
git log
# ๋ ๊ฐ์ ์ต๊ทผ ์ปค๋ฐ์ ์ญ์
git reset --hard HEAD~2 # ๋ก์ปฌ์ ๋ด์ฉ๋ ๋ณ๊ฒฝ
# git reset --soft HEAD~2 # ๋ก์ปฌ์ ๋ณ๊ฒฝ ๋ด์ฉ์ ๊ทธ๋๋ก ์ ์ง
# git stash # ๋ณ๊ฒฝ์ฌํญ์ ์์๋ก ์ ์ฅ
# ์ด์ ์ปค๋ฐ์ผ๋ก ๊ฐ์ ํธ์ฌ
git push --force origin main
# git stash pop # ๋ณ๊ฒฝ์ฌํญ์ ๋ค์ ์ ์ฉ
๋๋
# ํ๋ก์ ํธ ๋ด์ ํน์ ํ ๊ณ์ ์ผ๋ก ๋์ด์๋ ์ปค๋ฐ์ด ์๋์ง ํ์ธ
git log --author="์ฌ์ฉ์์ด๋ฆ"
# commit hash ๊ฐ -> ์ญ์ ํ๊ณ ์ถ์ ์ฒซ๋ฒ์งธ commit ๋ฐ๋ก ์ง์ ์ commit hash.
# ์ด๋ฆฐ git rebase editor์ ์ญ์ ํ๊ณ ์ถ์ commit๋ค์ pick -> drop์ผ๋ก ๋ณ๊ฒฝ
git rebase -i <commit hash>
# ์ด์ ์ปค๋ฐ์ผ๋ก ๊ฐ์ ํธ์ฌ
git push --force origin main
์ง์ฐ๊ณ ์ถ์ contributor์ commit๋ค์ ์ง์ ์ง๋ง,
๋ ํ์งํ ๋ฆฌ์ ์ฐ์ธก contributor๋ชฉ๋ก์๋ ์์ง ๊ณ์ ์ด ์กด์ฌํจ.
View all branches
โ Rename branch
์์
main
๋ธ๋์น ์ด๋ฆ์ main1
๋ก ๋ณ๊ฒฝ ํ, ๋ค์ main
์ผ๋ก ๋ณ๊ฒฝํ๋ฉด contributor๊ฐ ์ญ์ ๋๋ค.