๐Ÿ’git cherry-pick์ด ๋ฌด์—‡์ธ๊ฐ€์š”? ๐Ÿ’

2644 ๋‹จ์–ด git

์ฒด๋ฆฌํ”ฝ์ด๋ž€?



git-cherry-pick - Apply the changes introduced by some existing commits



https://git-scm.com/docs/git-cherry-pick

$ git cherry-pick [--edit] [-n] [-m parent-number] [-s] [-x] [--ff]
          [-S[<keyid>]] <commit>โ€ฆโ€‹
$ git cherry-pick (--continue | --skip | --abort | --quit)


[์‚ฌ์šฉ ์‚ฌ๋ก€]
๋‹น์‹ ์€ develop์˜ ๋ธŒ๋žœ์น˜์—์„œ ์ž‘์—…ํ•˜๊ณ  ์žˆ๊ณ  ๋™๋ฃŒ๋„ develop์˜ ๋ธŒ๋žœ์น˜์—์„œ ์ž‘์—…ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ/๊ทธ๋…€๋Š” ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค(์ปค๋ฐ‹ ID xxxyyyzzz000). ๋‹น์‹ ์€ ๊ทธ/๊ทธ๋…€์˜ ๋ธŒ๋žœ์น˜์—์„œ ๊ทธ ๋ฒ„๊ทธ ์ˆ˜์ •์„ ๊ฐ€์ ธ์˜ค๊ณ  ์‹ถ์ง€๋งŒ ๊ทธ/๊ทธ๋…€๊ฐ€ ํ•œ ์ปค๋ฐ‹์€ ๋ฐ›์•„๋“ค์ด๊ณ  ์‹ถ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๋ณ‘ํ•ฉ๊ณผ ์ฒด๋ฆฌ ํ”ฝ์˜ ์ฐจ์ด์ 





$ git cherry-pick 61240658a3f26bd3b69cb961de4da9ef363fff35 # commit ID


์ปค๋ฐ‹ ID ํ™•์ธ ๋ฐฉ๋ฒ•


  • ๋กœ๊ทธ์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • $ git log
    
    commit 61240658a3f26bd3b69cb961de4da9ef363fff35
    Author: Koji <>
    Date:   Thu Sep 24 16:41:16 2020 -0400
    
        Update programming.py
    
    commit d85d4ddc01f2a28205c3e57abe8fe38f378f4857
    Author: Koji <>
    Date:   Thu Sep 24 14:54:23 2020 -0400
    
        Update programming.py
    
    


    ๊ทธ๋Ÿฐ๋ฐ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ „์ฒด ์ปค๋ฐ‹ ID๊ฐ€ ํ•„์š”ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
    GitHub๊ฐ€ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์— ํ‘œ์‹œํ•˜๋Š” ๋์—์„œ ์•ฝ 6 digits๋งŒ ์žˆ์œผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
  • GitHub/Gitlab ๋“ฑ์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋กœ ์ด๋™ํ•˜์—ฌ ๋ธŒ๋žœ์น˜์—์„œ ์ปค๋ฐ‹์„ ํ™•์ธํ•˜์„ธ์š”.

    ์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ