๐Ÿ“š TIL 29์ผ์ฐจ

temprmnยท2023๋…„ 6์›” 26์ผ
0
post-thumbnail

์˜ค๋Š˜์˜ ์ฃผ์š”์‚ฌํ•ญ (6/26, ์›”์š”์ผ)

  1. Lv3 ๊ณผ์ œ ๋Œ€๋น„ ํ•™์Šต

๋ชธ์‚ด๋‚ฌ์–ด์š”

[Git] local ์ปค๋ฐ‹ ๋‚ด์šฉ๋“ค์„ remote ์ €์žฅ์†Œ๋กœ ์˜ฎ๊ธฐ๊ธฐ

๊ฐ•์˜๋ฅผ ๋“ค์œผ๋ฉด์„œ ํ•™์Šตํ•œ ๋‚ด์šฉ๋“ค์„ ๋กœ์ปฌ ์ €์žฅ์†Œ์— ์ปค๋ฐ‹ํ•ด๋’€๋Š”๋ฐ, ๋ง ๊ทธ๋Œ€๋กœ ๋กœ์ปฌ์— ์ €์žฅํ•œ ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋‚ด๊ฐ€ ๋กœ์ปฌ ์ €์žฅ์†Œ๋ฅผ ์ฒญ์†Œํ•˜๋ฉด ํ•™์Šตํ•œ ๋‚ด์šฉ์ด ์ „๋ถ€ ๋‚ ์•„๊ฐ€๊ฒŒ ๋œ๋‹ค. ํŠนํžˆ๋‚˜ ํฌ๋งท์„ ์ž์ฃผํ•˜๋Š” ๋‚˜์—๊ฒŒ๋Š” ๋ฐฑ์—…์ด ์ •๋ง ์ค‘์š”ํ•˜๋‹ค.

๊ทธ๋ž˜์„œ ์›๊ฒฉ ์ €์žฅ์†Œ์— ์˜ฎ๊ฒจ์ฃผ๊ธฐ๋กœ ํ–ˆ๋‹ค! ๊ทธ๋ฆฌ๊ณ  ์ด ๊ณผ์ •์—์„  ๋งŽ์€ ์ผ์ด ์žˆ์—ˆ๋Š”๋ฐ....

ํ‰์†Œ์—๋Š” ์›๊ฒฉ์—์„œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋จผ์ € ์ƒ์„ฑํ•œ ํ›„์— โ†’ ๊ทธ๊ฑธ ์ €์žฅํ•  ์œ„์น˜์— cloneํ•˜๊ณ  โ†’ ๊ฑฐ๊ธฐ์— ํ”„๋กœ์ ํŠธ ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด์„œ ์ž‘์—…์„ ์‹œ์ž‘ํ•˜๋Š”๋ฐ, ์ด๋ฒˆ์—” ์กฐ๊ธˆ ๋‹ฌ๋ž๋‹ค.

์ด๋ฏธ ๋กœ์ปฌ์— ์ƒ์„ฑ๊ณผ ์ปค๋ฐ‹์ด ๋˜์–ด์žˆ๋Š” ํ”„๋กœ์ ํŠธ ํŒŒ์ผ์„ โ†’ ์ƒˆ๋กœ์šด ์›๊ฒฉ ์ €์žฅ์†Œ์— ์—…๋กœ๋“œ ํ•ด์•ผํ–ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋‘๊ฐ€์ง€ ๋ฐฉ๋ฒ•์„ ์ƒ๊ฐํ•ด๋ดค๋Š”๋ฐ(Git์€ ์ž˜ ๋ชจ๋ฅด์ง€๋งŒ)

  1. ๋กœ์ปฌ์—์„œ ์›๊ฒฉ ์ €์žฅ์†Œ๋ฅผ ์ƒ์„ฑํ•œ๋‹ค(?).
  2. ๋กœ์ปฌ๊ณผ ์›๊ฒฉ ์ €์žฅ์†Œ๋ฅผ ์—ฐ๊ฒฐํ•œ๋‹ค.

2๋ฒˆ์˜ ๋ฐฉ๋ฒ•์œผ๋กœ ์‹คํ–‰ํ–ˆ๊ณ , ์‹œํ–‰์ฐฉ์˜ค๊ฐ€ ๋งŽ์•„์„œ 30๋ถ„์€ ์žก์•„๋จน์€ ๋“ฏํ•˜๋‹ค. ์œ ์˜ํ•  ์ ์€ revision์ด main์ด์–ด์•ผํ•œ๋‹ค๋Š” ์‚ฌ์‹ค์ด๋‹ค. (cherry pick์„ ์‚ฌ์šฉํ–ˆ๋‹ค๋ฉด ๋‹ค์‹œ ์›์ƒํƒœ๋กœ ๋Œ๋ ค๋†”์•ผํ•œ๋‹ค๋Š” ๋œป์ด๋‹ค)

์ˆœ์„œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  1. ์ด๋ฏธ ์ƒ์„ฑ๋˜์—ˆ๊ณ , ๋กœ์ปฌ์— ์ปค๋ฐ‹๊นŒ์ง€ ์™„๋ฃŒ๋œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ค€๋น„ํ•œ๋‹ค.

  2. GitHub๋ฅผ ํ†ตํ•ด ์›๊ฒฉ ์ €์žฅ์†Œ๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.

  3. git bash๋ฅผ ์‹คํ–‰ํ•˜๊ณ , ๋กœ์ปฌ ์ €์žฅ์†Œ ๊ฒฝ๋กœ๋กœ ์ด๋™ํ•œ๋‹ค.

    $ cd {ํŒŒ์ผ ๊ฒฝ๋กœ}
    $ cd /c/Project/spring-auth
  4. remote ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ํ•ด๋‹น ๋กœ์ปฌ ์ €์žฅ์†Œ์— ์›๊ฒฉ ์ €์žฅ์†Œ๋ฅผ ์—ฐ๊ฒฐํ•ด์ค€๋‹ค.

    $ git remote add origin {์›๊ฒฉ ์ €์žฅ์†Œ URL}
    $ git remote add origin https://github.com/jungeun5-choi/test.git
  5. branch๊ฐ€ main์œผ๋กœ ์„ค์ •๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•œ๋‹ค.

    $ git branch -M main
  6. ์ง€๊ธˆ๊นŒ์ง€ ๋กœ์ปฌ์— ์ปค๋ฐ‹๋œ ๊ฒƒ๋“ค์„ pushํ•œ๋‹ค.

    $ git push -u origin main

๊ทธ๋ž˜์„œ ์ด๋ฅผ ํ†ตํ•ด ๋งŽ์€ ์‹ค์Šต ์ž๋ฃŒ๋“ค์„ ์—…๋กœ๋“œ ํ•˜์˜€์Šต๋‹ˆ๋‹ค...
  1. spring-mvc
  2. spring-auth
  3. jpa-advance
  4. spring-resttemplate-client๊ณผ spring-resttemplate-server
  5. spring-myselectshop
profile
`ISFJ` T 49% F 51% /

0๊ฐœ์˜ ๋Œ“๊ธ€