๐ก ์ด์ ์ ์ปค๋ฐ์์ Google OAuth Secret์ ์ฝ๋ ๋ด๋ถ์ ์์ฑ ํ ์ปค๋ฐํ์ฌ Push Rejected ๋์๋ค. ํด๋น ๋ด์ฉ์ ๋น๋ฐ์ด ์์ฑ๋ ์ปค๋ฐ์ ์์ ํ๊ณ ํธ์ฌํ๋ ๊ณผ์ ์ด๋ค.
Commit ID ๊ฒ์
- git log ํ์ธ
- IDEA Git Log ํ์ธ
- Git Project Repository ํ๋ฉด์์ Commits ํ์ธ
Git Rebase
๊ฒ์๋ Commit ID๋ก Rebase ์คํํ์ฌ ์์ฑ๋ ์ปค๋ฐ ์ด์ ์ํ๋ก ๋์๊ฐ๋ฏ๋ก ๋ฌธ์ ์๋ ์ฝ๋๋ฅผ ์์ ํ๋ค.
# ~2 : ํด๋น ์ปค๋ฐ์์๋ถํฐ 2๊ฐ์ ์ปค๋ฐ ์ด์ ์ ์๋ฏธ
git rebase -i <Commit-ID>~2
# ์์ ํ Commit์ edit์ผ๋ก ๋ณ๊ฒฝ
pick 22a79af [feat] Initialize project
pick a3f5d3d [fix] Fix authentication issue <---- pick์ edit์ผ๋ก ์์
pick c8d9eab [chore] Update dependencies
pick 3c9770a [feat] Add user registration feature
Git Commit Amend
์ด๋ฏธ ์ปค๋ฐ๋ ๋ด์ฉ์ ์์ ๋ ๋ด์ฉ์ ์ถ๊ฐํ ๋ ์ฌ์ฉํ๋ ์ต์ ์ผ๋ก ์ต๊ทผ์ ์ํํ ๋ง์ง๋ง ์ปค๋ฐ์ ์์ ํ ๋ ์ฌ์ฉ๋ฉ๋๋ค.
๋ง์ฝ N๋ฒ์งธ ์ด์ ์ Commit์ด ์๋๋ผ ๋ฐ๋ก ์ด์ ์ Commit์ด๋ผ๋ฉด ๋ฌธ์ ์ฝ๋๋ฅผ ์์ ํ ๋ฐ๋ก ํ์ฌ๋จ๊ณ๋ฅผ ์งํํ๋ฉด ๋ฉ๋๋ค.
git commit --amend
Git Rebase Continue
์์ ์งํ์ค ์ถฉ๋ ํ, ์ถฉ๋์ ํด๊ฒฐํ ๋ค์ ๋ฆฌ๋ฒ ์ด์ค๋ฅผ ๊ณ์ ์งํํ ๋ ์ฌ์ฉํ๋ ๋ช ๋ น์ด ์ ๋๋ค. ๋ง์ง๋ง Commit ์์ ์ผ๋ก ๋์์ฌ ๋ ๊น์ง ์งํํฉ๋๋ค.
git rebase --continue
์ดํ Push ์งํ ์ ๋ฐ๋ ค๋์ง์๊ณ ๋น๋ฐ์ด ์ ๊ฑฐ๋ ์ฝ๋๊ฐ ๋ฐ์๋ฉ๋๋ค.
Error
You must edit all merge conflicts and then mark them as resolved using git add
์ถฉ๋๋ ํ์ผ๋ค์ด ์๋ค๋ฉด ์์ ํ๊ณ ์์ ๋ ํ์ผ์ add ํฉ๋๋ค.
warning: in the working copy of 'src/app/api/users/route.js', LF will be replaced by CRLF the next time Git touches it
์ค๋ฐ๊ฟ ํ์์ด ๋ค๋ฅด๋ค๋ ๋ฌธ์ ์ด๋ฏ๋ก ๋ฌด์ํ๊ณ ์งํํ์ต๋๋ค.
Push of the current branch "master" was rejected. Remote changes need to be merged before pushing.
์๊ฒฉ ์ ์ฅ์์ ํธ์ํ๋ ค๊ณ ํ์ง๋ง, ์๊ฒฉ ์ ์ฅ์์ ์ด๋ฏธ ์๋ ๋ณ๊ฒฝ ์ฌํญ๊ณผ์ ์ถฉ๋๋ก ์ธํด ํธ์๊ฐ ๊ฑฐ๋ถ๋์์ผ๋ฏ๋ก Pull ๋ฐ๊ณ Push ์งํํ์ต๋๋ค.
'Git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Git PullRequest (0) | 2023.07.13 |
---|---|
Github subtree ์ ์ฅ์ ๋ด ์ ์ฅ์ ๊ด๋ฆฌ (0) | 2023.05.24 |