git pull
์ ์ ๋ง ๋น๋ฒํ๊ฒ ์ฌ์ฉํ๋ค.git fetch
๋ ๋น๋ฒํ๊ฒ ์ฌ์ฉํ์ง๋ ์์ง๋ง ์์๋ง ํ๋ฉด ํ ๋ฒ์ฉ ๋ง์ฃผ์น๋ค.- ๋์ ๋ํ ๋ด ์ง์์ ์ด ์ ๋.
fetch
๋ฆฌ๋ชจํธ์ ๋ด์ฉ์ ๊ฐ์ ธ์ค๊ธฐ๋ง ํ๊ณ ๋ณํฉํ์ง ์์.pull
๋ฆฌ๋ชจํธ์ ๋ด์ฉ์ ๊ฐ์ ธ์ค๊ณ ๋ณํฉํจ.fetch + merge
โ๏ธ ๊ทผ๋ฐfetch
๋ฅผ ํ๋ฉด ๊ทธ๋์ ์ ํํ ์ด๋ค ์ํ๊ฐ ๋๋ค๋ ๊ฒ์ธ์ง ๋ชจ๋ฅด๊ณ ์๋ค๋ ๊ฑธ ๋ฌธ๋ ๊นจ๋ฌ์.- ๊ทธ๋์ ์ ๋ฆฌํ๋ค.
git fetch [remote-name]
- ๋ฆฌ๋ชจํธ์ ๋ด์ฉ์ ์ ๋ถ ๋ก์ปฌ์ ๊ฐ์ ธ์ค์ง๋ง ๋ณํฉํ์ง๋ ์๋๋ค.
- fetch ๋ฅผ ํ ๊ฒฝ์ฐ ๋ก์ปฌ์์ ๋ฆฌ๋ชจํธ์ ๋ชจ๋ ๋ธ๋์น์ ์ ๊ทผํ ์ ์๊ธฐ ๋๋ฌธ์ ๋ค์๊ณผ ๊ฐ์ ์ผ๋ค์ด ๊ฐ๋ฅํด์ง.
- ๋ก์ปฌ์์ ๋ฆฌ๋ชจํธ ๋ชจ๋ ๋ธ๋์น์ ์ฝ๋ ํ์ธํ๊ธฐ
- ๋ฆฌ๋ชจํธ์ ํน์ ๋ธ๋์น ๋ณํฉํ๊ธฐ
- ๋ฆฌ๋ชจํธ์ ํ์ํ ์ปค๋ฐ๋ง ๊ฐ์ ธ์ค๊ธฐ
- ๋ฑ๋ฑ
- til ํ๋ก์ ํธ์ remote ์ฐ๊ฒฐ์ ์ง์ฐ๊ณ 20210817 ์ปค๋ฐ์ ์ญ์ ํ๋ค.
- ๋ก์ปฌ์ ๋ง์ง๋ง ์ปค๋ฐ.
2193e64 (HEAD -> master) [20210816]_jetbrains_last_edit_location.md
- ๋ชจ๋ ๋ธ๋์น ํ์ธ
$ git branch -a
* master
- ๋ค์ ๋ฆฌ๋ชจํธ ์ฐ๊ฒฐ.
git remote add origin https://github.com/yj-oh/til.git
$ git fetch origin
From https://github.com/yj-oh/til
* [new branch] master -> origin/master
- ๋ชจ๋ ๋ธ๋์น ํ์ธ
$ git branch -a
* master
remotes/origin/master
-
๋ฆฌ๋ชจํธ์
origin/master
๊ฐ ๋ณด์ธ๋ค. -
๋ก์ปฌ master์ ๋ง์ง๋ง ์ปค๋ฐ์ ์ฌ์ ํ,
2193e64 (HEAD -> master) [20210816]_jetbrains_last_edit_location.md
origin/master
๋ธ๋์น๋ก ์ฒดํฌ์์ ํด์ ๋ง์ง๋ง ์ปค๋ฐ์ ํ์ธํด๋ณด๋ฉด,
5023f9c (HEAD, origin/master) [20210817]_article_vs_section.md
- ๋ก์ปฌ์ master ๋ธ๋์น์์
origin/master
๋ณํฉ
git merge origin/master
- ๋ค์ ๋ก๊ทธ๋ฅผ ํ์ธํด๋ณด๋ฉด,
5023f9c (HEAD -> master, origin/master) [20210817]_article_vs_section.md
git pull master
ํ ๊ฒ๊ณผ ๊ฐ์ ์ํ๊ฐ ๋์๋ค.