Skip to content

Latest commit

ย 

History

History
80 lines (65 loc) ยท 2.17 KB

[20210818]_fetch.md

File metadata and controls

80 lines (65 loc) ยท 2.17 KB

fetch

  • git pull์€ ์ •๋ง ๋นˆ๋ฒˆํ•˜๊ฒŒ ์‚ฌ์šฉํ•œ๋‹ค.
  • git fetch๋Š” ๋นˆ๋ฒˆํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜์ง€๋Š” ์•Š์ง€๋งŒ ์žŠ์„๋งŒ ํ•˜๋ฉด ํ•œ ๋ฒˆ์”ฉ ๋งˆ์ฃผ์นœ๋‹ค.
  • ๋‘˜์— ๋Œ€ํ•œ ๋‚ด ์ง€์‹์€ ์ด ์ •๋„.
    • fetch ๋ฆฌ๋ชจํŠธ์˜ ๋‚ด์šฉ์„ ๊ฐ€์ ธ์˜ค๊ธฐ๋งŒ ํ•˜๊ณ  ๋ณ‘ํ•ฉํ•˜์ง€ ์•Š์Œ.
    • pull ๋ฆฌ๋ชจํŠธ์˜ ๋‚ด์šฉ์„ ๊ฐ€์ ธ์˜ค๊ณ  ๋ณ‘ํ•ฉํ•จ. fetch + merge
  • โ‰๏ธ ๊ทผ๋ฐ fetch๋ฅผ ํ•˜๋ฉด ๊ทธ๋ž˜์„œ ์ •ํ™•ํžˆ ์–ด๋–ค ์ƒํƒœ๊ฐ€ ๋œ๋‹ค๋Š” ๊ฒƒ์ธ์ง€ ๋ชจ๋ฅด๊ณ  ์žˆ๋‹ค๋Š” ๊ฑธ ๋ฌธ๋“ ๊นจ๋‹ฌ์Œ.
  • ๊ทธ๋ž˜์„œ ์ •๋ฆฌํ•œ๋‹ค.

๐Ÿ‘‰ 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
  • fetch

$ 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 ํ•œ ๊ฒƒ๊ณผ ๊ฐ™์€ ์ƒํƒœ๊ฐ€ ๋˜์—ˆ๋‹ค.