๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Git ๊ด€๋ จ

[Git] : macOS 'ํ„ฐ๋ฏธ๋„'์—์„œ git push ์˜ค๋ฅ˜๋ฉ”์‹œ์ง€, ์˜ค๋ฅ˜ํ•ด๊ฒฐ.

by ๊ถŒ์Šพํ–„ 2023. 6. 7.

remote: Permission to cooderyg/nbc-movie-team.git denied to Yooonzero.

fatal: unable to access 'https://github.com/cooderyg/nbc-movie-team.git/': The requested URL returned error: 403
HTTP 403 Forbidden ํด๋ผ์ด์–ธํŠธ ์˜ค๋ฅ˜ ์ƒํƒœ ์‘๋‹ต ์ฝ”๋“œ๋Š” ์„œ๋ฒ„์— ์š”์ฒญ์ด ์ „๋‹ฌ๋˜์—ˆ์ง€๋งŒ, ๊ถŒํ•œ ๋•Œ๋ฌธ์— ๊ฑฐ์ ˆ๋˜์—ˆ๋‹ค๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.
remote: Permission to cooderyg/nbc-movie-team.git denied to Yooonzero.
fatal: unable to access 'https://github.com/cooderyg/nbc-movie-team.git/': The requested URL returned error: 403

// ํŒ€ํ”„๋กœ์ ํŠธ๋ฅผ ์œ„ํ•ด ํ•ด๋‹น ๋ ˆํผ์ง€ํ† ๋ฆฌ์— push๋ฅผ ํ•ด์•ผ๋˜๋Š” ์ƒํ™ฉ.
// ์ด๋ฏธ clone ์„ ๋ฐ›์•„์˜จ ์šฐ๋ฆฌ ํŒ€์›์˜ ๋ ˆํผ์ง€ํ† ๋ฆฌ์— ์ ‘๊ทผ๊ถŒํ•œ์ด ์—†๋‹ค๋Š” ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒ
// ๋‚˜์˜ ๋ ˆํผ์ง€ํ† ๋ฆฌ์— push๋ฅผ ํ•ด๋ณด์•„๋„ ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ๋ฐœ์ƒ.
// ์˜ค๋ฅ˜ ํ•ด๊ฒฐ ๊ณผ์ • ์ •๋ฆฌ
remote: Support for password authentication was removed on August 13, 2021.

remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.

fatal: Authentication failed for 'https://github.com/Yooonzero/JS2.git/'
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Yooonzero/JS2.git/'

์œ„์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ๋˜๋Š”

remote: Permission to Yooonzero/JS2.git denied to Yooonzero.

fatal: unable to access 'https://github.com/Yooonzero/JS2.git/': The requested URL returned error: 403
remote: Permission to Yooonzero/JS2.git denied to Yooonzero.
fatal: unable to access 'https://github.com/Yooonzero/JS2.git/': The requested URL returned error: 403

์˜ค๋Š˜ ๋งŒ๋‚œ ์˜ค๋ฅ˜๋“ค.

์˜ค๋Š˜ git push ๋ฅผ ์œ„ํ•ด์„œ ๋‚ด๊ฐ€ ์ง„ํ–‰ํ–ˆ๋˜ ๊ณผ์ •์„ ์ˆœ์„œ๋Œ€๋กœ ์ •๋ฆฌํ•ด๋ณด์ž.


1. ํ„ฐ๋ฏธ๋„ ์‹คํ–‰ ํ›„ push ํ•˜๊ณ ์‹ถ์€ ํŒŒ์ผ์ด ์žˆ๋Š” ๊ฒฝ๋กœ๋กœ ์ด๋™.

% cd Desktop/Toy1/JS2
// ๋ช…๋ น์–ด : cd <๊ฒฝ๋กœ>
// ๋œป : cd ๋ช…๋ น์–ด๋กœ vscode๋ฅผ ์‹คํ–‰ํ•˜๊ณ ์ž ํ•˜๋Š” ํด๋”๋กœ ์ด๋™.

1-1. ๊ฒฝ๋กœ ์ด๋™์ด ์ž˜ ๋˜์—ˆ๋Š”์ง€ pwd ๋กœ ํ™•์ธ.

% pwd
// ๋œป : ํ˜„์žฌ ํ„ฐ๋ฏธ๋„์ด ์‹คํ–‰๋˜๊ณ  ์žˆ๋Š” ๊ฒฝ๋กœ ํ™•์ธ ๋ช…๋ น์–ด.
// ์ถœ๋ ฅ๊ฐ’ : /Users/yoonzero/Desktop/Toy1/JS2

2. ์ด๋™ํ•œ ๊ฒฝ๋กœ์˜ ํด๋”์—์„œ vscode ์‹คํ–‰ ํ›„ push ํ•ด์ฃผ๊ณ  ์‹ถ์€ ๋‚ด์šฉ ํ™•์ธ.

% code .
// ํ˜„์žฌ ํด๋” ๋ฐ ํŒŒ์ผ์—์„œ vscode๋ฅผ ์‹คํ–‰์‹œ์ผœ์คŒ.
// ํ•ด๋‹น ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ํ„ฐ๋ฏธ๋„์—์„œ vscode๋ฅผ ์—ด๊ธธ ์›ํ•œ๋‹ค๋ฉด, ์•„๋ž˜ ํ•ญ๋ชฉ ์„ค์น˜ ํ•„์ˆ˜
// ๋‹จ์ถ•ํ‚ค : vscode ์‹คํ–‰ ํ›„ command + shift + p

๋‹จ์ถ•ํ‚ค : mac = command + shift + p / ์œˆ๋„์šฐ = ctrl + shift + p

3. git init

% git init
// ๋œป : git push ๋˜๋Š” git add ์™€ ๊ฐ™์€ git๊ณผ ๊ด€๋ จ๋œ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ๋ช…๋ น์–ด
$ ls -al
// ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ(ํด๋”์™€ ๊ฐ™์€ ๋œป)์— ๋ชจ๋“  ํŒŒ์ผ์„ ๋ณด์—ฌ์ค€๋‹ค.(์ˆจ๊น€ํŒŒ์ผ๋„ ํฌํ•จ)
// git init ์œผ๋กœ .git ์ด๋ผ๋Š” ์ˆจ๊น€ํด๋”๊ฐ€ ์ž˜ ์ƒ์„ฑ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•œ๋‹ค.

// ์ถœ๋ ฅ๊ฐ’
drwxr-xr-x@  9 yoonzero  staff   288  6  7 14:11 .
drwxr-xr-x@  6 yoonzero  staff   192  6  7 14:11 ..
-rw-r--r--@  1 yoonzero  staff  6148  6  4 18:09 .DS_Store
drwxr-xr-x@ 12 yoonzero  staff   384  6  7 14:16 .git     // .git ํ™•์ธ ์™„๋ฃŒ!
drwxr-xr-x@  2 yoonzero  staff    64  6  2 21:54 assets
-rw-r--r--   1 yoonzero  staff  3620  6  7 13:58 index.html
-rw-r--r--   1 yoonzero  staff  2067  6  7 13:59 sdfsdf
drwxr-xr-x@  5 yoonzero  staff   160  6  7 14:05 src
drwxr-xr-x@  3 yoonzero  staff    96  6  2 21:54 style

4. git add .

% git add .
// git add ๋Š” ๋ณ€๊ฒฝํ•œ ํŒŒ์ผ์ „์ฒด์—์„œ ๋‚ด๊ฐ€ ์ €์žฅํ•˜๊ณ  ์‹ถ์€ ํŒŒ์ผ๋งŒ ๊ณจ๋ผ ์˜ฌ๋ฆด์ˆ˜ ์žˆ๋‹ค.
// . ์€ ๋ชจ๋“  ํŒŒ์ผ์„ ์ „๋ถ€ ์ €์žฅํ•œ๋‹ค๋Š” ๋œป์ด๋‹ค.

5. git commit -m "์ปค๋ฐ‹๋ฉ”์‹œ์ง€"

% git commit -m "์ด ๋ถ€๋ถ„์€ ์ž์œ ๋กญ๊ฒŒ ์ž‘์„ฑ"
// git commit ์€ ๋‚ด๊ฐ€ git add ๋กœ ์˜ฌ๋ ค์ค€ ํŒŒ์ผ๋งŒ ์ €์žฅํ•  ์ˆ˜ ์žˆ๋‹ค.

// git add ๋Š” ๋ณ€๊ฒฝํ•œ ์ „์ฒด ํŒŒ์ผ์ค‘์—์„œ ๋ช‡๋ช‡๊ฐœ ํŒŒ์ผ๋งŒ ์ง€์ •ํ•ด์„œ ์ง€์ •ํ•œ ํŒŒ์ผ๋“ค๋งŒ ์ €์žฅ์„ ํ•ด์ค„์ˆ˜๋„ ์žˆ๊ณ ,
// git commit ์€ add๋กœ ์˜ฌ๋ ค์ค€ ํŒŒ์ผ๋“ค ์ „๋ถ€๋ฅผ ์ €์žฅ ํ•ด์ค€๋‹ค.
// ์ €์žฅํ•  ํŒŒ์ผ์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋ƒ, ์—†๋ƒ๊ฐ€ git add ์™€ git commit์˜ ์ฐจ์ด์ ์ด๋‹ค.
// ๋”ฐ๋ผ์„œ add๋กœ ์ €์žฅํ•  ํŒŒ์ผ์„ ์„ ํƒํ•˜๊ณ  commit์œผ๋กœ ์ปค๋ฐ‹์„ ์ง„ํ–‰ํ•˜๋Š”๊ฒƒ์ด๋‹ค.

์—ฌ๊ธฐ์„œ ๋ถ€ํ„ฐ ์˜ค๋ฅ˜ ๋ฐœ์ƒ

6. git push origin <pushํ•  ๋ธŒ๋žœ์น˜๋ช…>

% git push origin main
// window ์—์„œ๋Š” ๋ฐ”๋กœ push ๊ฐ€ ๋˜์—ˆ๋‹ค.

// mac์—์„œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ ๋‚ด์šฉ์ด ์ถœ๋ ฅ๋œ๋‹ค.
Username for 'https://github.com': // config --global ์— ์ €์žฅํ•œ user.name์„ ์จ์ฃผ๊ณ 
Password for 'https://yoonzero@github.com': // ์•ก์„ธ์Šค ํ† ํฐํ‚ค๊ฐ’์„ ๋„ฃ์–ด์ค˜์•ผํ•œ๋‹ค.
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/Yooonzero/JS2.git/'
// ์ฒ˜์Œ ๋งŒ๋‚œ ์˜ค๋ฅ˜ ๊ฐ’

์•„๋ž˜ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์˜จ ์ด์œ  : github ๋กœ๊ทธ์ธ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ํƒ€์ดํ•‘ํ•ด์„œ.

 

์œ„ ์˜ค๋ฅ˜ ๋‚ด์šฉ์„ ์š”์•ฝ ํ•˜๋ฉด 2021๋…„ 8์›” 13์ผ ๋ถ€๋กœ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์ง€์›ํ•˜๋Š” ๋ฐฉ์‹์ด ๋ณ€๊ฒฝ๋˜์—ˆ์œผ๋‹ˆ ํ™•์ธํ•ด๋ผ.

๊ธฐ์กด ๋ฐฉ์‹ - > ํ† ๊ธ€ํ‚ค๋กœ ๋ณ€๊ฒฝ๋˜์—ˆ๋‹ค๊ณ  ํ•œ๋‹ค.


ํ† ๊ธ€ํ‚ค ๊ด€๋ จ ํ•ด๊ฒฐ ์ˆœ์„œ

6-1. ๋‚ด๊ฐ€ ํ† ๊ธ€ํ‚ค๋ฅผ ๋ฐ›์•˜๋Š”์ง€ ์•ˆ๋ฐ›์•˜๋Š”์ง€, ํ˜น์€ ๊ธฐ๊ฐ„์ด ๋งŒ๋ฃŒ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๋Ÿฌ git ์‚ฌ์ดํŠธ๋กœ ๊ฐ„๋‹ค.

์„ธํŒ…์œผ๋กœ ๋“ค์–ด๊ฐ„๋‹ค.

6-2. ์ขŒ์ธก ์ œ์ผ ํ•˜๋‹จ์— Developer settings ํด๋ฆญ

6-3. ์ขŒ์ธก 3๋ฒˆ์งธ Personal access toKens์˜ Fine-grained toKens ํด๋ฆญํ•˜๊ณ  ์šฐ์ธก์— Generate new toKen ํด๋ฆญ

์ด ํ† ํฐ์€ ์ƒ์„ฑํ•˜๊ณ  ๋‚˜์˜ค๋Š” ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณต์‚ฌํ•ด์„œ ๋”ฐ๋กœ ๋ณด๊ด€ํ•ด๋‘์–ด์•ผ ํ•œ๋‹ค.

์ด๋ฏธ ํ† ํฐํ‚ค๊ฐ€ ์žˆ์œผ๋‚˜, ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณต์‚ฌํ•ด ๋‘์ง€ ๋ชปํ–ˆ์œผ๋ฉด ๊ทธ๋ƒฅ delete ํ•˜๊ณ  ๋‹ค์‹œ ๋งŒ๋“ค์–ด๋„ ๋ฌด๋ฐฉํ•˜๋‹ค.

 

6-4. name ๋ฐ Expiration์€ ๋ณธ์ธ์˜ ๊ธฐํ˜ธ์— ๋งž๊ฒŒ ์ž‘์„ฑ ํ›„์— ์•„๋ž˜์ชฝ์— ๋ฆฌ์ŠคํŠธ๋กœ ๋„˜์–ด๊ฐ„๋‹ค.

6-5. ๋ ˆํผ์ง€ํ† ๋ฆฌ ์—‘์„ธ์Šค๋ฅผ ๋‚˜๋Š” ๋ชจ๋“  ๋ ˆํผ์ง€ํ† ๋ฆฌ๋กœ ํ•ด์ฃผ์—ˆ๋‹ค. ์˜ค๋Š˜ ์ด ํ˜„์ƒ์œผ๋กœ ํ† ํฐํ‚ค ์žฌ๋ฐœ๊ธ‰๋งŒ 3๋ฒˆ์งธ์— ํ˜„์žฌ ์˜ค๋ฅ˜๋กœ ์žฅ์žฅ 6์‹œ๊ฐ„์„ ๋งค๋‹ฌ๋ ธ๊ธฐ ๋•Œ๋ฌธ์—, ๋ชจ๋“  ๊ถŒํ•œ์„ ์ตœ๋Œ€ํ•œ ๋Ÿฌํ”„ํ•˜๊ฒŒ ์ง„ํ–‰ํ•˜๊ธฐ๋กœ ํ–ˆ๋‹ค.

๋˜ํ•œ ๋ฐ‘์— Permissons์—์„œ 'secret' ์ด ๋“ค์–ด๊ฐ€๋Š” ํ•ญ๋ชฉ์€ ์ „๋ถ€ 'write and read' ๋กœ ์ฒดํฌํ–ˆ๋‹ค.

6-6. ์ฒดํฌ ํ–ˆ์œผ๋ฉด generate toKen ํด๋ฆญํ•ด์„œ ํ‚ค ์ƒ์„ฑ.

6-7. ํ‚ค๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๋‚˜์˜จ http ๋ฅผ ๋ณต์‚ฌํ•ด์„œ ๋‚˜๋Š” ๋ฉ”๋ชจ์žฅ์— ๋ณด๊ด€ํ–ˆ๋‹ค.

// ์˜ˆ์‹œ

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

์ด๋Ÿฐ ํ† ํฐํ‚ค๋ฅผ ์ƒ์„ฑํ–ˆ์œผ๋ฉด ์ค€๋น„ ๋. ๋‹ค์‹œ ํ„ฐ๋ฏธ๋„๋กœ ๊ฐ„๋‹ค.


7. ์ด์ œ ํ™•์ธํ•  ๋ถ€๋ถ„์€ ํ˜„์žฌ git ์— ์ €์žฅ๋˜์–ด์žˆ๋Š” ๋‚˜์˜ user.name , user.email , user.password ์ด๋‹ค. config --list ๋กœ ํ™•์ธํ•ด๋ณธ๋‹ค.

% git config --list
// git์— ์ €์žฅํ•œ user.name, user.email, user.password ์ „๋ถ€ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•œ ๋ช…๋ น์–ด

// ์ถœ๋ ฅ๊ฐ’
credential.helper=osxkeychain
init.defaultbranch=main
user.name= ๋ณด์•ˆ์ƒ
user.email= ๋น„๋ฐ€
user.password= ์œ„์˜ ์˜ˆ์‹œ์ธ ํ† ํฐํ‚ค๊ฐ€ ์—ฌ๊ธฐ ๋“ค์–ด๊ฐ„๋‹ค
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/Yooonzero/JS2.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
๋‚ด ํ† ํฐํ‚ค์™€ ์ €์žฅ๋œ user.password ๊ฐ€ ๋‹ค๋ฅธ๊ฒฝ์šฐ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•
% git config global --user.password "์—ฌ๊ธฐ์— ์ƒ์„ฑํ•œ ํ‚ค๊ฐ’์„ ๋„ฃ์–ด์ค€๋‹ค. (""๋ฅผ ์ด์šฉํ•ด ๋ฌธ์ž์—ด๋กœ)"

// ํ˜น์‹œ name ๋˜๋Š” email ๋„ ๋‹ค๋ฅด๊ฑฐ๋‚˜ ์ €์žฅ์ด ์•ˆ๋˜์–ด์žˆ๋‹ค๋ฉด,

% git config global --user.name "git ์‚ฌ์ดํŠธ์— ๋กœ๊ทธ์ธํ•˜๋Š” ์•„์ด๋””(์ด๋ฉ”์ผ ์•„๋‹˜)"
% git config global --user.email "git ์‚ฌ์ดํŠธ์— ๋กœ๊ทธ์ธํ•˜๋Š” ์ด๋ฉ”์ผ"
// ์œ„์™€ ๊ฐ™์ด ์ €์žฅํ•ด์ค€๋‹ค. 

// ์ €์žฅ ํ›„์— config --list ๋กœ ์ €์žฅ์ด ์ž˜ ๋˜์—ˆ๋Š”์ง€ ํ™•์ธ

8. ์ผ์น˜ํ•จ์„ ํ™•์ธํ•˜๋ฉด, ๋‹ค์‹œ ํ„ฐ๋ฏธ๋„์—์„œ push ์ง„ํ–‰ํ•˜๋ฉด ์ •์ƒ์ ์œผ๋กœ ์ž‘๋™ํ•˜๋Š”๊ฒŒ ํ™•์ธ ๊ฐ€๋Šฅ.

% git push origin main

Username for 'https://github.com': ๋น„๋ฐ€
Password for 'https://yooonzero@github.com': 
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 8 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (13/13), 5.72 KiB | 5.72 MiB/s, done.
Total 13 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), done.
To https://github.com/Yooonzero/JS2.git
 * [new branch]      main -> main
 
 // push ์™„๋ฃŒ

9. github์—์„œ branch ํ™•์ธ.

main branch ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ํ‘ธ์‰ฌ๋œ๊ฑธ ํ™•์ธํ–ˆ๋‹ค.


๊ทธ ์™ธ ์‹œ๋„ํ•ด ๋ณธ๊ฒƒ๋“ค..
ํ‚ค์ฒด์ธ ์ ‘๊ทผ ์•”ํ˜ธ ์‚ญ์ œ ๋ฐ ๋ณ€๊ฒฝ

mac ์—๋Š” ์‚ฌ์ดํŠธ์˜ ํ‚ค๋ฅผ ์ €์žฅํ•ด๋†“๋Š” 'ํ‚ค์ฒด์ธ์ ‘๊ทผ'์ด๋ผ๋Š” ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์žˆ๋‹ค.

// ๋ฐ”ํƒ•ํ™”๋ฉด์—์„œ command + spacebar

// ํ‚ค์ฒด์ธ ์ ‘๊ทผ ๊ฒ€์ƒ‰

๋“ค์–ด๊ฐ€๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ์•„์ด์ฝ˜๋“ค์ด ์žˆ์„ ์ˆ˜ ์žˆ๋‹ค.
(๋‚œ ๋งจ์ฒ˜์Œ ์˜ค๋ฅ˜ ๋งŒ๋‚ฌ์„๋•Œ๋Š” github.com์ด ์—†์—ˆ๋Š”๋ฐ ํ•ด๊ฒฐ๊ณผ์ •์—์„œ ์–ด๋А์ˆœ๊ฐ„ ์ƒ๊ฒผ๋‹ค.)

์˜ค๋Š˜ ์ด ์•”ํ˜ธ๋ฅผ ์ง€์šฐ๋ผ๋Š” ์‚ฌ๋žŒ๋“ค์ด ๋งŽ์•˜๋Š”๋ฐ ์•ž์œผ๋กœ๋Š” ๊ทธ๋ƒฅ ๋ง‰ ์ง€์›Œ๋ฒ„๋ฆฌ์ง€ ๋ง๊ณ , ์•„๊นŒ์ฒ˜๋Ÿผ config --list ์—์„œ ๋‚ด ํ˜„์žฌ ๋น„๋ฐ€๋ฒˆํ˜ธ์™€ ์ผ์น˜ํ•˜๋ฉด ๋‚ด๋ฒ„๋ ค ๋‘์ž.

์‹ฌ์ง€์–ด ์˜ค๋Š˜ ์ด๊ฑฐ๋ฅผ ์‚ญ์ œ๋ฅผ ํ•˜๋ผ๊ณ  ํ•ด์„œ ์œ„์˜ 2๊ฐœ ์•„์ด์ฝ˜์„ ์—ด์‹ฌํžˆ ์‚ญ์ œ๋ฅผ ๋ˆŒ๋ €์ง€๋งŒ ์‚ญ์ œ์•ˆ๋จ... ์™œ ๊ทธ๋Ÿฐ์ง€๋Š” ์ด์œ ๋Š” ๋ชจ๋ฅด๊ฒ ๋‹ค.

์ถ”๊ฐ€๋กœ ์ ‘๊ทผ์ œ์–ด์— vscode ๋‚˜ terminal ์—†์–ด๋„ ์ •์ƒ์ ์œผ๋กœ push๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค.

๊ณ„์ • ์ •๋ณด ์‚ญ์ œ
// ์˜ค๋Š˜ ์œ„์—์„œ config --list๋กœ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋ณด์•˜์„๋•Œ 1๋ฒˆ์— osxkeychain ์ด๋ผ๋Š” ๋‹จ์–ด๋ฅผ ๋ณด๊ณ ๋‚˜์„œ
// ์‹คํ–‰ํ•œ ๋ฐฉ๋ฒ•, ๊ฒฐ๊ตญ์—๋Š” ํšจ๊ณผ๋ฅผ ๋ณด์ง€ ๋ชปํ–ˆ๋‹ค.
// ์•„๋ฌด๊ฒƒ๋„ ์‹คํ–‰์ด ๋˜์ง€ ์•Š์•˜์—ˆ๋‚˜, ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์™”์—ˆ๋‚˜ ํ•˜๋„ ๊ป๋‹ค ์ผฐ๋‹ค๋ฅผ ๋งŽ์ด ํ•ด์„œ ๊ธฐ์–ต์ด ๋‚˜์ง€ ์•Š๋Š”๋‹ค.
// ์ฐธ๊ณ ์‚ผ์•„ ๋ธ”๋กœ๊ทธ์— ์ €์žฅํ•ด๋‘”๋‹ค.

% git credential-osxkeychain erase
host=github.com
protocol=https

// ๊ณ„์ •์‚ญ์ œํ•˜๋Š” ๋ช…๋ น์–ด
์š”์•ฝ ์ •๋ฆฌ

1. ์™ ๋งŒํ•ด์„œ๋Š” ํ„ฐ๋ฏธ๋„ ๋ง๊ณ  vscode ์—์„œ push ๋˜๋Š” pull ์„ ์ง„ํ–‰ํ•˜์ž.

๊ฐœ์ธ์ ์ธ ์ด์œ  : ํ„ฐ๋ฏธ๋„์„ ์—ด๊ณ  vscode ๋„ ์—ด๋ฉด ์„œ๋กœ ํ„ฐ๋ฏธ๋„์„ ์™”๋‹ค๊ฐ”๋‹ค ํ•˜๋Š” ๊ณผ์ •์—์„œ ์˜ค๋ฅ˜ ๋ฐœ์ƒ ํ™•๋ฅ ์ด ๋” ํฐ๊ฒƒ ๊ฐ™๋‹ค๋Š” ์ƒ๊ฐ.

2. ์–ด๋””์—์„œ ์ง„ํ–‰ํ•˜๋˜ ํ† ๊ธ€ํ‚ค์™€ name ๋งŒํผ์€ ์ผ์น˜ํ•œ์ง€ ํ™•์‹คํžˆ ํ™•์ธ

๋‹ค๋ฅผ ๊ฒฝ์šฐ : ์žฌ๋ฐœ๊ธ‰ ํ›„ ๋ณ€๊ฒฝ๋œ ํ‚ค๊ฐ’์œผ๋กœ git config ์„ธํŒ…

3. ๊ทธ๋Ÿผ์—๋„ ์˜ค๋ฅ˜๊ฐ€ ๋‚œ๋‹ค๋ฉด ํ‚ค์ฒด์ธ ํ™•์ธํ•ด์„œ ์ €์žฅ๋œ ๋ฐ์ดํ„ฐ ํ™•์ธ ๋ฐ ์ˆ˜์ •, ๋˜๋Š” ์‚ญ์ œ.

์ด๋ ‡๊ฒŒ ํ•œ๋‹ค๋ฉด ์˜ค๋Š˜๊ฐ™์€ ์˜ค๋ฅ˜๋Š” ์™ ๋งŒํ•ด์„œ ํ•ด๊ฒฐ์ด ๊ฐ€๋Šฅํ• ๊ฑฐ๋ผ ์ƒ๊ฐํ•œ๋‹ค.


#git #git_push_์˜ค๋ฅ˜ #403 #permission_to_ #git_config_์˜ ์ค‘์š”์„ฑ #config_list_ํ™•์ธํ•„์ˆ˜ #mac_ํ‚ค์ฒด์ธ #ํ† ๊ธ€ํ‚ค #ํ™•์ธํ•„์ˆ˜


// ์˜ค๋Š˜ ์‹ค์ˆ˜๋กœ git config --'์—ฌ๊ธฐ์— global์„' ๋นผ๊ณ  ์ณค์„ ๋•Œ ๋‚˜์˜จ ์˜ค๋ฅ˜.
// ๋งŽ์€ ์˜ต์…˜ ๋ช…๋ น์–ด๋ฅผ ๋ณด์—ฌ์ค˜์„œ ์ €์žฅํ•ด ๋‘˜๋ ค๊ณ  ์ž‘์„ฑํ•จ.
// usage = ์šฉ๋ฒ•

git config --user.password "๋ณด์•ˆ์ƒ ๋น„๋ฐ€"
error: unknown option `user.password'
usage: git config [<options>]

Config file location
    --global              use global config file
    --system              use system config file
    --local               use repository config file
    --worktree            use per-worktree config file
    -f, --file <file>     use given config file
    --blob <blob-id>      read config from given blob object

Action
    --get                 get value: name [value-pattern]
    --get-all             get all values: key [value-pattern]
    --get-regexp          get values for regexp: name-regex [value-pattern]
    --get-urlmatch        get value specific for the URL: section[.var] URL
    --replace-all         replace all matching variables: name value [value-pattern]
    --add                 add a new variable: name value
    --unset               remove a variable: name [value-pattern]
    --unset-all           remove all matches: name [value-pattern]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    --fixed-value         use string equality when comparing values to 'value-pattern'
    -e, --edit            open an editor
    --get-color           find the color configured: slot [default]
    --get-colorbool       find the color setting: slot [stdout-is-tty]

Type
    -t, --type <type>     value is given this type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --bool-or-str         value is --bool or string
    --path                value is a path (file or directory name)
    --expiry-date         value is an expiry date

Other
    -z, --null            terminate values with NUL byte
    --name-only           show variable names only
    --includes            respect include directives on lookup
    --show-origin         show origin of config (file, standard input, blob, command line)
    --show-scope          show scope of config (worktree, local, global, system, command)
    --default <value>     with --get, use default value when missing entry