DevOps/Git
[Git] ์ด๋ฏธ Pushํ Commit ์ญ์ ํ๊ธฐ
sol_git
2024. 12. 11. 10:00

๐ Github ์๋ฒ์ Pushํ ๊ฐ์ฅ ์ต์ Commit์ ์ทจ์ํ๊ณ ์ญ์ ํ๋ ๋ฐฉ๋ฒ

- $ git log : ์ญ์ ํ commit์ ํ์ธํ๋ค.

2. $ git reset HEAD^ : ๊ฐ์ฅ ์์ ์๋ ์ต์ commit์ ์ญ์ ํ๋ค

3. $ git push -f origin "๋ธ๋์น๋ช
" : github ์๋ฒ์๋ ์ต์ commit ์ญ์ ํ ๊ฒ์ ์๋ฆผ
ex) git push -f origin devBranch
โญ ์ฃผ์
: -f (force) ์ต์ ์ ๋งค์ฐ ์ฃผ์ํด์ ์จ์ผ ํ๋ค.
๋ค๋ฅธ ์ฌ๋๋ค๊ณผ ํจ๊ป ํ์ ํ๋ ๊ฒฝ์ฐ, git history๊ฐ ๊ผฌ์ฌ์ merge ์์ ๋ฌธ์ ๊ฐ ์๊ธธ ์ ์๋ค.