[Git] ๊ฐ์ธํ๋ก์ ํธ ์ฒ์ ์์์ github ๊ด๋ จ ์ค๋ฅ ํด๊ฒฐ๋ฐฉ๋ฒ
์ค๋๋ง์ ๊ฐ์ธ ํ๋ก์ ํธ๋ฅผ ์์ํ๋๋ฐ ์ฌ๋ ํ ์ด ๊ธธ๋ค๋ณด๋ ๋งค๋ฒ ์์ํ ๋๋ง๋ค git ๊ด๋ จ ์ค๋ฅ๋๋ฌธ์ ๊ตฌ๊ธ๋งํ๋ ์๊ฐ์ด ์๊น์ ๊ธฐ๋ก์ฉ์ผ๋ก ๋จ๊น๋๋ค.
์์ค ์ฝ๋ ์์ฑํ๊ณ ์ด๋ฐ์ ๋ฐ ํ ์คํธ ํด๋ณด๊ณ github repo ์์ฑํ์ push ํ๋ ค๊ณ ํ๋๋ฐ
% git init
% git remote add origin {github url}
% git push --set-upstream origin main
Password for 'https://aaaaaa@github.com':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/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/aaaaaa/test.git/'
์ด๋ ๊ฒ ์๋ฌ๊ฐ ๋๋ค๋ฉด Password ๋์ Personal Access Token(PAT) ๊ฐ์ ๋ฃ์ด์ฃผ๋ฉด ๋จ.
PAT ๋ github๊ณ์ ์ค์ (repo ์ค์ ์๋) > Developer Settings > Personal access tokens (classic) ์์ ๋ฐ๊ธ๋ฐ์ ์ ์์.
๊ทธ๋ฆฌ๊ณ ๋ธ๋์น ์ด์๋ก ์๋์ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค๋ฉด..
% git checkout main
branch 'main' set up to track 'origin/main'.
Switched to a new branch 'main'
% git merge prod
fatal: refusing to merge unrelated histories
% git merge prod --allow-unrelated-histories
์ด ๋ช ๋ น์ด๋ก ํด๊ฒฐํ ์ ์์