
git pull ์๋
% git pull origin update
// update ๋ธ๋์น๋ฅผ ๋ฐ์์ค๋ ๋ช
๋ น์ด
hint ๊ตฌ๊ฐ ๋ฐ์
ํ์ ์ ํตํด์ ๋ค๋ฅธ์ฌ๋์ด pushํด๋ ๋ ํผ์งํ ๋ฆฌ๋ฅผ ์ฒ์์ผ๋ก pull ํ๊ฒ ๋๋ ๊ฒฝ์ฐ ์๋์ ๊ฐ์ ๋ฉ์์ง๊ฐ ๋์ค๊ฒ ๋๋ค.
From https://github.com/cooderyg/nbc-movie-team
* branch update -> FETCH_HEAD
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint: git config pull.rebase false # merge
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.
์ ๋ฉ์์ง๋ Git์์ ๋ฐ์ํ๋ ๋ถ๊ธฐ๋ ๋ธ๋์น(divergent branches)๋ฅผ ์กฐ์จํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์๋ด์ด๋ค.
ํ์ฌ ๋ถ๊ธฐ๋ ๋ธ๋์น๊ฐ ์๊ณ ์ด๋ฅผ ์กฐ์จํ๋ ๋ฐฉ๋ฒ์ ์ง์ ํด์ผ ํ ๋ ๋ฐ์ํ๋ ๋ฉ์์ง.
๋ถ๊ธฐ๋ ๋ธ๋์น๋ฅผ ์กฐ์จํ๊ธฐ ์ํด ๋ค์ ์ค ํ๋์ ๋ช ๋ น์ด๋ฅผ ์คํํด์ผ ํ๋ค.
์ด ๋ช ๋ น์ด๋ ๋ค์ pull ์์ ์ ์ํํ๊ธฐ ์ ์ ์คํํด์ผ ํ๋ค.
git config pull.rebase false // ๋ณํฉ(merge) ๋ฐฉ์์ ์ฌ์ฉํ์ฌ ๋ธ๋์น๋ฅผ ์กฐ์จํฉ๋๋ค.
git config pull.rebase true // ๋ฆฌ๋ฒ ์ด์ค(rebase) ๋ฐฉ์์ ์ฌ์ฉํ์ฌ ๋ธ๋์น๋ฅผ ์กฐ์จํฉ๋๋ค.
git config pull.ff only // Fast-forward๋ง์ ํ์ฉํ์ฌ ์กฐ์จํฉ๋๋ค.
git config pull.rebase ์ ๊ฐ์ด false ๋ผ๋ฉด merge๊ฐ ์งํ์ด ๋๋๊ฒ์ด๊ณ ,
git config pull.rebase ์ ๊ฐ์ด true ๋ผ๋ฉด rebase๊ฐ ์งํ์ด ๋๋๋ฐ,
์ฃผ๋ก pull.rebase๊ฐ์ด true ๊ฐ์ ์ ํธํ๋ค๊ณ ํ๋ค.
์ด์ ๋ ๋ฐ๋ก merge ๊ฐ ์คํ๋๋ฉด, ์ถฉ๋์ด ์ผ์ด๋๊ธฐ ๋๋ฌธ์,
์ฐ์ rebase๋ก ๋ฐ์ดํฐ๋ฅผ ๋ฐ์์จ ํ์ ๊ฒํ ํ
merge๋ ์๋์ ์ผ๋ก ์งํํ๋ค๋ ์๋์ด๋ค.
๋๋ ๋ค์๊ณผ ๊ฐ์ด ์ธํ ์ ๋ง์น ํ ๋ค์ pull์ ์งํํ๋ค.
% git config pull.rebase true // ํด๋น๋ช
๋ น์ด๋ฅผ ํตํด์
// pull.rebase์ ๊ฐ์ด true๋ก ์ถ๋ ฅ๋๋๋ก ์ธํ
์ ํด์ฃผ๊ณ ,
% git pull origin update
// ๋ค์ pull์ ์งํ.
์ด๋ ๊ฒ ์งํ์ ํ๊ฒ ๋๋ฉด, ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ์ ๋ง์ฃผ์น๊ฒ ๋๋ค.
From https://github.com/cooderyg/nbc-movie-team
* branch update -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.
๋ค์ ๋ช ๋ น์ด๋ก ๋ค์ ์ํฉ์งํ์ด ๊ฐ๋ฅํ๋ค.
% git pull --rebase
// ์ถ๋ ฅ ๊ฐ
emote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 18 (delta 12), reused 18 (delta 12), pack-reused 0
Unpacking objects: 100% (18/18), 1.98 KiB | 144.00 KiB/s, done.
From https://github.com/cooderyg/nbc-movie-team
* [new branch] sub -> origin/sub
There is no tracking information for the current branch.
Please specify which branch you want to rebase against.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> delete
์ฐ๋ฆฌ๊ฐ ๋ฐฉ๊ธ ์ git pull --rebase ๋ฅผ ํ๊ธฐ ์ ์ ๋์์๋ ์ค๋ฅ์ค์
fatal: Not possible to fast-forward, aborting.
๊ฐ์ ๊ฒฝ์ฐ์๋ merge๊ฐ ๋ถ๊ฐ๋ฅํ๊ณ ,
merge๊ฐ ํ์ํ ๊ฒฝ์ฐ์๋ ์ ๋ฐฉํฅ์ผ๋ก ์งํํ๋ ๊ฒ ๋ถ๊ฐ๋ฅํ๋ค๋ ์๋ฌ ๋ฉ์์ง๊ฐ ๋จ๋ฉด์ ์งํ์ ํ์ง ์๋ ๊ฒ์ด๋ผ ํ๋ค.
์์ ๊ฐ์ ๊ฒฝ์ฐ์์ ๋ฌธ์ ๋ฅผ ๊ทผ๋ณธ์ ์ผ๋ก ํด๊ฒฐํ๋ ค๋ฉด fast-forward only ์ต์
์ ๊บผ์ผ ํ๋ค๊ณ ํ๋ค.
์ต์
์ ๋๋ ๋ฒ์ ๋ค์๊ณผ ๊ฐ๋ค.
% git config --unset pull.ff
ํด๋น ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํด์ฃผ๊ณ ๋ค์ pull ์ ์๋ํ๋ค.
% git pull origin update
From https://github.com/cooderyg/nbc-movie-team
* branch update -> FETCH_HEAD
Successfully rebased and updated refs/heads/delete.
์ฑ๊ณต์ ์ผ๋ก update ๋ธ๋์น๋ฅผ ๋ฐ์์ค๋๋ฐ ์ฑ๊ณต !
git์ ๋ํด์๋ ์์ง ๋ง์ด ๋ค๋ค๋ณด์ง ์์๋ค ๋ณด๋,
์ค๋ฅ๋ฅผ ๋ด๋ ์ผ์ผํ ๊ตฌ๊ธ๋ง์ ํตํด ํด์ํ๊ณ ๋ถ๋ชํ๋ด์ผ ํ๋ค.
์๊ฐ์ด ๋ง์ด ์์๋์ง๋ง,
์ธ๋ฅ ๋ง์ ์ค๋ฅ๋ค์ ๊ฒช์ด๊ฐ๋ฉด์,
ํ๋ํ๋์ ๋
ธํ์ฐ๊ฐ ์์์ผ๋ฉด ํ๋ ๋ฐ๋จ์ด๋ค.
2023/06/27
ํ์ฌ ์์ ์ค์ ์์ ๊ฐ์ ์ํฉ์ด ํ ๋ฒ๋ ๋ฐ์ํ๋ค.
๋๊ฐ์ด ํํธ๊ตฌ๊ฐ์ด ๋ฐ์ํ์๊ณ ,
๋ค์ ์ฝ๋๋ฅผ ํตํด์ ์งํ์ ํ๋ค.
% git config --global pull.rebase true // ์ด๋ฒ์๋ global์ ํตํด ์ ์ญ์ผ๋ก ์ธํ
์๋.
% git pull origin main
// ๋ค์ pull์ ์งํ.
์ฝ๋๋ฅผ ์์๊ฐ์ด ์งํํ๋,
์ด๋ฒ์๋ merge๋ก ์ธํ ์ถฉ๋์ด ๋ฐ์ํ์๊ณ ,
vscode์์ ์์ ํ ๋ถ๋ถ์ ์ ํํด ์ญ์ ํ๊ณ merge๋ฅผ ์งํํ๋,
๋ค์๊ณผ ๊ฐ์ ๋ฉ์์ง๊ฐ ๋์๋ค.
From https://github.com/issuebombom/team_destructure_project
* branch main -> FETCH_HEAD
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase. If that is the
case, please try
git rebase (--continue | --abort | --skip)
If that is not the case, please
rm -fr ".git/rebase-merge"
and run me again. I am stopping in case you still have something
valuable there.
์ ์ค๋ฅ ๋ฉ์์ง๋ ๋ฆฌ๋ฒ ์ด์ค(rebase) ์์ ์ค์ ๋ค๋ฅธ ๋ฆฌ๋ฒ ์ด์ค ์์ ์ด ์ด๋ฏธ ์งํ ์ค์ธ ๊ฒฝ์ฐ์ ๋ฐ์ํ ์ ์๋ค.
ํด๊ฒฐ๋ฐฉ์์ ํ์ฌ ๋ฆฌ๋ฒ ์ด์ค ์์
์ ์๋ฃํ๊ฑฐ๋ ์ค๋จํ๊ณ ๋ค๋ฅธ ์์
์ ์งํํด์ผ ํ๋ค.
ํด์ํ์๋ฉด, ์ด ์ค๋ฅ ๋ฉ์์ง๋ ์ด๋ฏธ ๋ฆฌ๋ฒ ์ด์ค ์์
์ด ์งํ ์ค์ธ ์ํ์์ ๋ ๋ค๋ฅธ ๋ฆฌ๋ฒ ์ด์ค ์์
์ ์๋ํ๋ ค๊ณ ํ ๋ ๋ฐ์.
๋ฉ์์ง๋ ํ์ฌ ์งํ ์ค์ธ ๋ฆฌ๋ฒ ์ด์ค ์์ ์ ์๋ฃํ๊ฑฐ๋ ์ค๋จํ๊ณ ๋ค๋ฅธ ์์ ์ ์ํํด์ผ ํจ์ ๋ช ์.
์ค๋ฅ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ผ์ผ ํ๋ค.
- ๋ง์ฝ ํ์ฌ ์งํ ์ค์ธ ๋ฆฌ๋ฒ ์ด์ค ์์ ์ ์๋ฃํ๋ ค๋ฉด, git rebase --continue ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค. ์ด ๋ช ๋ น์ด๋ ํ์ฌ ์งํ ์ค์ธ ๋ฆฌ๋ฒ ์ด์ค ์์ ์ ๊ณ์ํฉ๋๋ค.
- ๋ง์ฝ ํ์ฌ ์งํ ์ค์ธ ๋ฆฌ๋ฒ ์ด์ค ์์ ์ ์ค๋จํ๋ ค๋ฉด, git rebase --abort ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค. ์ด ๋ช ๋ น์ด๋ ํ์ฌ ์งํ ์ค์ธ ๋ฆฌ๋ฒ ์ด์ค ์์ ์ ์ทจ์ํ๊ณ ์ด์ ์ํ๋ก ๋๋๋ฆฝ๋๋ค.
- ํ์ฌ ์งํ ์ค์ธ ๋ฆฌ๋ฒ ์ด์ค ์์ ์ด ์๋๋ฐ๋ ์ด ์ค๋ฅ๊ฐ ๊ณ์ ๋ฐ์ํ๋ค๋ฉด, .git/rebase-merge ๋๋ ํ ๋ฆฌ๋ฅผ ์ญ์ ํ ๋ค์ ์์ ์ ๋ค์ ์คํํฉ๋๋ค. ๋๋ ํ ๋ฆฌ๋ฅผ ์ญ์ ํ๊ธฐ ์ํด rm -fr ".git/rebase-merge" ๋ช ๋ น์ด๋ฅผ ์คํํฉ๋๋ค.

๋๋ ์ฒซ๋ฒ์งธ ๋ช ๋ น์ด๋ฅผ ํตํด์ ๊ธฐ์กด์ rebase ์์ ์ ์งํ์์ผฐ๋ค.
// ์ถ๋ ฅ๊ฐ
Successfully rebased and updated refs/heads/mypage.
Successfully rebased and updated refs/heads/mypage๋ ๋ฆฌ๋ฒ ์ด์ค ์์ ์ด ์ฑ๊ณต์ ์ผ๋ก ์๋ฃ๋์๊ณ , refs/heads/mypage ๋ธ๋์น๊ฐ ์ ๋ฐ์ดํธ๋์๋ค๋ ์๋ฏธ์ด๋ค.
๋ฆฌ๋ฒ ์ด์ค ์์ ์ ๊ธฐ์กด ์ปค๋ฐ๋ค์ ์์๋ฅผ ๋ณ๊ฒฝํ๊ฑฐ๋ ๋ค๋ฅธ ๋ธ๋์น์ ๋ณ๊ฒฝ ์ฌํญ์ ํตํฉํ๋ ์์ ์ด๋ค.
์์ ๋ฉ์์ง๋ ๋ฆฌ๋ฒ ์ด์ค ์์
์ด ์ฑ๊ณต์ ์ผ๋ก ์๋ฃ๋์์ผ๋ฉฐ, refs/heads/mypage ๋ธ๋์น๊ฐ ํด๋น ์์
์ผ๋ก ์
๋ฐ์ดํธ๋์๋ค๋ ๊ฒ์ ๋ํ๋.
๋ฆฌ๋ฒ ์ด์ค ์์
์ด ์ฑ๊ณต์ ์ผ๋ก ์ํ๋์ด ์ํ๋ ๊ฒฐ๊ณผ๋ฅผ ์ป์์ผ๋ฉฐ, mypage ๋ธ๋์น๊ฐ ๋ฆฌ๋ฒ ์ด์ค ์์
์ ์๋ก์ด ์ปค๋ฐ์ผ๋ก ์
๋ฐ์ดํธ๋์๋ค๋ ๊ฒ์ ์๋ ค์ฃผ๋ ๋ฉ์์ง์
๋๋ค.
#git_pull_์ค๋ฅ #git #fatal #unset_pull_ff #__rebase #pull_rebase_true_false #merge_rebase #git_hint
'Git ๊ด๋ จ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Github] : gitignore ์ฌ์ฉํด๋ณด๊ธฐ. (0) | 2023.07.13 |
---|---|
[MarkDown] : github README.md ํ์ผ์ ์์ฑํด๋ณด๊ธฐ. (0) | 2023.06.17 |
[MarkDown] : README.md ํ์ผ ์์ฑ์ ์ํ ๋งํฌ๋ค์ด ๋ฌธ๋ฒ ์ ๋ฆฌ. (0) | 2023.06.17 |
[Git] : macOS 'ํฐ๋ฏธ๋'์์ git push ์ค๋ฅ๋ฉ์์ง, ์ค๋ฅํด๊ฒฐ. (0) | 2023.06.07 |
<TIL> / Git ๊ธฐ์ด (Git bash ๋จ์ถํค) .1 (3) | 2023.05.15 |