์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- ์์๋ฒํธ
- ์๋น์ค ํ๋ฆฌ๋ฏธํฐ๋ธ
- leetcode
- ๊ฐ๋ฐ์์ทจ์
- ์ค๋ฅ๊ฒ์ถ
- reducible
- tcp ์ธ๊ทธ๋จผํธ
- ํญํด99
- ์ค๋ธ์
- ๋ฐ์ดํฐ ์ ์ก
- git merge
- i-type
- 99ํด๋ฝ
- ์ฝ๋ฉํ ์คํธ์ค๋น
- tcp ํ๋กํ ์ฝ
- xv6
- ์ค๋ฅ์ ์ด
- ํ ํฐ ๋ฒ์ค
- ๋น์ฃผ๊ธฐ์ ํธ
- ์ฃผ๊ธฐ์ ํธ
- mariadb
- ํ๋ก์ด๋์์
- til
- ํ๋ ์ ๊ตฌ์กฐ
- ํฐ์คํ ๋ฆฌ์ฑ๋ฆฐ์ง
- ๊ทธ๋ฆฌ๋ ์๊ณ ๋ฆฌ์ฆ
- well known ํฌํธ
- ์ค๋ ๋
- ์ฐ๋ถํฌdb
- IEEE 802
- Today
- Total
Unfazedโ๏ธ๐ฏ
git fetch, git pull ๋ณธ๋ฌธ
๋ฆฌ๋ชจํธ ์ ์ฅ์
๊นํ๋ธ ๋ ํฌ์งํ ๋ฆฌ(๋ฆฌ๋ชจํธ ์ ์ฅ์)๋ฅผ Clone ํ ๋ git clone ๋ช ๋ น์ ์๋์ผ๋ก ๋ฆฌ๋ชจํธ ์ ์ฅ์๋ฅผ "origin"์ด๋ผ๋ ์ด๋ฆ์ผ๋ก ์ถ๊ฐํ๋ค.
๋ฆฌ๋ชจํธ ์ ์ฅ์๋ git remote ๋ช ๋ น์ผ๋ก ํ์ธํ ์ ์๋ค. (-v ์ต์ ์ผ๋ก fetch์ push URL ํ์ธ ๊ฐ๋ฅ)
๋ค๋ฅธ ์ฌ๋์ด ์์ ๋ณ๊ฒฝ ์ฌํญ์ ๋ฆฌ๋ชจํธ ์ ์ฅ์(main branch)์ ํธ์ฌํ์ ๋ ๋ก์ปฌ ์ ์ฅ์๋ ์ด๋ฅผ ๋ฐ๋ก ์ธ์งํ์ง ๋ชปํ๋ค.
๋ก์ปฌ ์ ์ฅ์์์ ๋ฆฌ๋ชจํธ ์ ์ฅ์์ ๋ณ๊ฒฝ์ฌํญ์ ์ธ์งํ๊ธฐ ์ํด์๋ fetch๋ฅผ ํด์ผ๋๋ค.
git fetch
- ๋ก์ปฌ ์ ์ฅ์์ ์ด๋ฏธ ์กด์ฌํ๋ ๋ฐ์ดํฐ๋ฅผ ์ ์ธํ๊ณ ์๊ฒฉ ์ ์ฅ์(remote repository)์์ ๋ฐ์ดํฐ(๋ธ๋์น, ํ๊ทธ ๋ฑ)์ ๊ฐ์ ธ์ด
- ๊ฐ์ ธ์จ ๋ฐ์ดํฐ๋ ๋ก์ปฌ์ .git ๋๋ ํ ๋ฆฌ์ ์ ์ฅ๋์ง๋ง, ์๋์ผ๋ก ๋ณํฉ(merge)๋์ง๋ ์์
- ๊ธฐ๋ณธ์ ์ผ๋ก 'origin' ์๊ฒฉ ์ ์ฅ์์์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ด
๋ฆฌ๋ชจํธ ์ ์ฅ์์ ๋ธ๋์น๋ฅผ ๋ก์ปฌ์์ ์ ๊ทผ ๊ฐ๋ฅํ์ฌ, ํ์ํ ์์ ์ ์ธ์ ๋ ์ง merge๋ฅผ ํ๊ฑฐ๋ ๋ฆฌ๋ชจํธ ์ ์ฅ์์ ๋ด์ฉ์ ํ์ธํ ์ ์๋ค.
git pull
- ์๊ฒฉ ์ ์ฅ์์ ๋ณ๊ฒฝ์ฌํญ์ ๊ฐ์ ธ์์ merge๊น์ง ํ๋ฒ์ ์ํ
- ํ์ฌ ์์ ์ค์ธ ๋ธ๋์น์ ์ฆ์ merge๋จ
git pull์ ํตํด ์๋ ๋ ๋ช ๋ น์ด(git fetch,git merge origin/main)๋ฅผ ์ฐ์์ผ๋ก ์คํํ๋ ๊ฒ๊ณผ ๊ฐ์ ํจ๊ณผ๋ฅผ ์ป์ ์๋ค.
git fetch
git merge origin/main
์ฌ์ฉ์ด ์ ์ ํ ์ํฉ
fetch
- ์๊ฒฉ์ ๋ณ๊ฒฝ์ฌํญ์ ๋จผ์ ๊ฒํ ํ๊ณ ์ถ์ ๋
- ํ์ฌ ์์ ์ค์ธ ๋ด์ฉ์ด ์์ ๋
- ์ถฉ๋ ๊ฐ๋ฅ์ฑ์ ๋จผ์ ํ์ธํ๊ณ ์ถ์ ๋
pull
- ์๊ฒฉ์ ์ต์ ๋ณ๊ฒฝ์ฌํญ์ ๋ฐ๋ก ์ ์ฉํ๊ณ ์ถ์ ๋
- ๋ก์ปฌ ์์ ์ด ์๊ฑฐ๋ ์ถฉ๋ ๊ฐ๋ฅ์ฑ์ด ๋ฎ์ ๋
- ๋น ๋ฅด๊ฒ ๋๊ธฐํ๊ฐ ํ์ํ ๋
์ฐธ๊ณ ์๋ฃ :
https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
Git - Working with Remotes
Remote repositories can be on your local machine. It is entirely possible that you can be working with a “remote” repository that is, in fact, on the same host you are. The word “remote” does not necessarily imply that the repository is somewhere e
git-scm.com
https://git-scm.com/docs/git-fetch
Git - git-fetch Documentation
The fetch and push protocols are not designed to prevent one side from stealing data from the other repository that was not intended to be shared. If you have private data that you need to protect from a malicious peer, your best option is to store it in a
git-scm.com
'Git, GitHub' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
git rebase ๋์ ๊ณผ์ , ์ฃผ์์ฌํญ, merge vs rebase (0) | 2025.01.10 |
---|---|
git merge, merge ์ข ๋ฅ(Fast-forward Merge, 3-way Merge), merge conflict ๋ฐ์ ์ด์ ๋ฐ ํด๊ฒฐ ๋ฐฉ๋ฒ (0) | 2025.01.10 |