Notice
Recent Posts
Recent Comments
ยซ   2024/12   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
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
Archives
Today
In Total
๊ด€๋ฆฌ ๋ฉ”๋‰ด

A Joyful AI Research Journey๐ŸŒณ๐Ÿ˜Š

Git, Mac) ์ด๋ฏธ ์ปค๋ฐ‹ํ•œ Committer ์ด๋ฆ„ ํ•˜๋‚˜์”ฉ ๋ณ€๊ฒฝํ•˜๊ธฐ ๋ณธ๋ฌธ

๐Ÿ’ปBootcamp Self-Study Revisionโœจ/Git, GitHub

Git, Mac) ์ด๋ฏธ ์ปค๋ฐ‹ํ•œ Committer ์ด๋ฆ„ ํ•˜๋‚˜์”ฉ ๋ณ€๊ฒฝํ•˜๊ธฐ

yjyuwisely 2023. 6. 10. 18:05
์—ฌ๋Ÿฌ ๋ช…์ด ์ปค๋ฐ‹์„ ํ•ด์„œ ํ•˜๋‚˜ ๋˜๋Š” ์„ ํƒํ•œ ํŒŒ์ผ๋งŒ Committer์„ ๋ฐ”๊ฟ€ ๋•Œ 


ํ•˜๋‹จ์˜ ์ฝ”๋“œ๋ฅผ ํ„ฐ๋ฏธ๋„์— ์ ์–ด์„œ ์ž์‚ฐ์˜ ๊นƒํ—ˆ๋ธŒ ์•„์ด๋””์™€ ์ด๋ฉ”์ผ์ด ๋งž๋Š”์ง€ ์ฒดํฌ ๊ฐ€๋Šฅํ•˜๋‹ค.
git config user.name

git config user.email

์ฒ˜์Œ์— ํ„ฐ๋ฏธ๋„์—์„œ ๊นƒํ—ˆ๋ธŒ ์•„์ด๋””, ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •ํ•  ๋•Œ 
๊นƒํ—ˆ๋ธŒ์—์„œ ๋ฐœ๊ธ‰๋ฐ›์€ ํด๋ž˜์‹ ํ† ํฐ(Tokens(Classic))์„ ๋น„๋ฐ€๋ฒˆํ˜ธ๋กœ ์‚ฌ์šฉํ•œ๋‹ค. 

1) ํด๋” ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•ด ์ฃผ๊ณ  

์˜ˆ์‹œ) cd /Users/yeongjinyu/Documents/github


2)
git clone์„ ํ•œ๋‹ค.

์˜ˆ์‹œ) git clone https://github.com/yjyuwisely/Traveling-from-Ulju-gun.git

git clone ๊นƒ์ฃผ์†Œ



3)
ํด๋” ๊ฒฝ๋กœ๋กœ ๋“ค์–ด๊ฐ„๋‹ค.
์˜ˆ์‹œ) cd /Users/yeongjinyu/Documents/github/Traveling-from-Ulju-gun



4) ์บ๋Ÿฟ(^) ๊ธฐํ˜ธ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํ•ด๋‹น ์ปค๋ฐ‹์„ ๊ฐ€๋ฆฌํ‚จ๋‹ค.

git rebase -i <commit-id>^

์˜ˆ์‹œ) git rebase -i 5282e95941ee89355c6f9b8e5fc8ee8d69fc88df^

ํ•˜๋‹จ์˜ ์ฝ”๋“œ๋Š” ์ด์ „์˜ ์ปค๋ฐ‹์„ ๊ฐ€๋ฆฌํ‚จ๋‹ค.

git rebase -i <commit-id>


์˜ˆ์‹œ) git rebase -i 842af4e192fe97ef58223ba07a1667f74d5658b1 



5) ํ„ฐ๋ฏธ๋„์—์„œ ๋ฌธ์ž ์ž…๋ ฅ์ด ์•ˆ๋œ๋‹ค๋ฉด i๋ฅผ ๋ˆ„๋ฅด์ž.
๋ณ€๊ฒฝํ•  ํŒŒ์ผ ์ด๋ฆ„์„ pick์—์„œ edit ๋˜๋Š” e๋กœ ๋ฐ”๊พผ๋‹ค.
์ˆ˜์ • ํ›„ ๋‚˜๊ฐ€๋Š” ๋ฐฉ๋ฒ•์€ ํ•˜๋‹จ๊ณผ ๊ฐ™๋‹ค.

  1. Press the Esc key to ensure you're in command mode.
  2. Type :wq (colon, followed by 'w' for write and 'q' for quit).
  3. Press Enter to save the changes and exit the editor.



6) ๊นƒํ—ˆ๋ธŒ ์•„์ด๋””์™€ ์ด๋ฉ”์ผ ์ฃผ์†Œ๋ฅผ ํ•˜๋‹จ์˜ ์ฝ”๋“œ๋กœ ํ„ฐ๋ฏธ๋„์— ์ ๋Š”๋‹ค.

git commit --amend --author="์•„์ด๋”” <์ด๋ฉ”์ผ์ฃผ์†Œ>"

 

์˜ˆ์‹œ) git commit --amend --author="yjyuwisely <yjyuwisely@gmail.com>"

git log --pretty=full (์ฒดํฌ ๊ฐ€๋Šฅ)
rm -fr .git/rebase-merge (remove a leftover rebase-merge directory)


7) ํ•˜๋‹จ์˜ ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅ ํ›„ rebase ์ž‘์—…์„ ์ข…๋ฃŒํ•œ๋‹ค.

git rebase --continue

์ˆ˜์ •ํ•œ ํ•ญ๋ชฉ ํ•˜๋‚˜ํ•˜๋‚˜๋งˆ๋‹ค ์œ„ ์ฝ”๋“œ๋ฅผ ํ„ฐ๋ฏธ๋„์— ์ ๋Š”๋‹ค.

์ตœ์ข…์ ์œผ๋กœ, ํ„ฐ๋ฏธ๋„์— ์•„๋ž˜ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜จ๋‹ค.
Successfully rebased and updated detached HEAD.

8) git push --force origin master

์ž์‹ ์˜ Branch์ด๋ฆ„์œผ๋กœ ์ˆ˜์ •ํ•˜๋ฉด ๋œ๋‹ค.

์ตœ์ข…์ ์œผ๋กœ, ์ˆ˜์ •์ด ๋œ๋‹ค!

โ–ผ ๋” ์‰ฌ์šด ๋ฐฉ๋ฒ•์œผ๋กœ ํ„ฐ๋ฏธ๋„์—์„œ ์กฐ๊ฑด์‹์„ ์‚ฌ์šฉํ•˜์—ฌ ์›ํ•˜๋Š” ์ปค๋ฐ‹ ID๋“ค์„ ๋ฐ”๊พธ๋Š” ๋ฐฉ๋ฒ•๋„ ์žˆ๋Š”๋ฐ ํ•˜๋‹จ์˜ ๊ธ€์„ ์ฐธ๊ณ ํ•œ๋‹ค.

2023.06.10 - [๐Ÿ’ป Self-Study Revisionโœจ/Git, GitHub] - Git, Mac) ์ปค๋ฐ‹ํ•œ ํ›„ ํŠน์ • Author, Committer์˜ ์ด๋ฆ„ ์ˆ˜์ •ํ•˜๊ธฐ

 

Git, Mac) ์ปค๋ฐ‹ํ•œ ํ›„ ํŠน์ • Author, Committer์˜ ์ด๋ฆ„ ์ˆ˜์ •ํ•˜๊ธฐ

์ฒ˜์Œ์— ํ„ฐ๋ฏธ๋„์—์„œ ๊นƒํ—ˆ๋ธŒ ์•„์ด๋””, ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •ํ•  ๋•Œ ๊นƒํ—ˆ๋ธŒ์—์„œ ๋ฐœ๊ธ‰๋ฐ›์€ ํด๋ž˜์‹ ํ† ํฐ(Tokens(Classic))์„ ๋น„๋ฐ€๋ฒˆํ˜ธ๋กœ ์‚ฌ์šฉํ•œ๋‹ค. 1) ํด๋” ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•ด ์ฃผ๊ณ  ์˜ˆ์‹œ) cd /Users/yeongjinyu/Documents/github 2)

yjyuwisely.tistory.com


https://madplay.github.io/post/change-git-author-name

 

git commit author ๋ณ€๊ฒฝ (์ปค๋ฐ‹ ์ž‘์„ฑ์ž ๋ณ€๊ฒฝํ•˜๊ธฐ)

git commit ์ž‘์„ฑ์ž๋ฅผ ์ž˜๋ชป ์ž…๋ ฅํ•˜์—ฌ push๊นŒ์ง€ ํ•ด๋ฒ„๋ ธ๋‹ค. ์ปค๋ฐ‹ ์ž‘์„ฑ์ž์˜ ์ด๋ฆ„์„ ๋‹ค์‹œ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์„๊นŒ?

madplay.github.io

https://velog.io/@jaeyeong815/git-์˜ˆ์ „-์ปค๋ฐ‹-๋ฉ”์‹œ์ง€-๋‚ด์šฉ-์ˆ˜์ •ํ•˜๊ธฐ

 

git rebase ์‚ฌ์šฉํ•˜์—ฌ ์˜ˆ์ „ ์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ๋‚ด์šฉ (์—ฌ๋Ÿฌ๊ฐœ) ์ˆ˜์ •ํ•˜๊ธฐ

git rebase๋ฅผ ์‚ฌ์šฉํ•ด๋ณด์ž

velog.io


728x90
๋ฐ˜์‘ํ˜•
Comments