2022. 10. 3. 06:52ใ๐ชดEtc/๐บ Git
์ง์ง git์ commit pull request๋ง ํ๋ค๊ฐ ์ฒ์์ผ๋ก bash๋ฅผ ์ด์ฉํด์ ์ ์ฅ์ ํตํฉ์ ํด๋ดค๋ค.
์ง์ง ์ฒ์์ ๊ฐ๊ณ ์์ ํ๋ค. ์ด๊ฑฐ ๋๋ฌด ๊ณ ์ํด์ ๊ธฐ๋ก์ฉ์ผ๋ก ๋จ๊ฒจ๋๋ค.
1.์ผ๋จ ์๋ก์ด new repo๋ฅผ ๋ง๋ ๋ค.
2.๋ฐํํ๋ฉด์ repo๋ ๋๊ฐ์ ์ด๋ฆ์ ๊ฐ์ง ํ์ผ์ ๋ง๋ค๊ณ
-1
#์ค๋ช #.git์ด ์๊ธด๋ค
$git init
-2
#๋ก์ปฌ์ด๋ git์ด๋ ์ฐ๊ฒฐ๋จ
$git clone ์๋ก ์ ์ฅ์.git
-3
#remoteํ๊ธฐ
$git remote add ์ด๋ฆ oldํ์ผ.git
...
๋ช๊ฐ ์ถ๊ฐํ๊ณ
$git remote -v
-4
#subtree์์ฑ
git subtree add --prefix ํด๋๋ช ์ด๋ฆ(3๋ฒ์ ์ด๋ฆ) ๋ธ๋์น๋ช
-5
$git push
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:zapnaa/abcappp.git'
์ด๋ ๊ฒ ์ค๋ฅ๋จ๋ฉด ๊ตฌ๊ธ์ ๋ณด๋ฉด ๋ค๋ฅธ๋ฐฉ์์ผ๋ก ํ๋ผ๊ณ ํ๋ค.
๊ทธ๊ฒ๋ ์๋์ stackoverflow์์ ๋ค์ ธ๋ณด๋๊น ์ฝ๋๊ฐ ์์ด์ ํด๊ฒฐํจ
'๐ชดEtc > ๐บ Git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ Git ] ํ๋ก์ ํธ๋ฅผ ํ๋ฉด์ Git Flow๋ฅผ ์ด๋ป๊ฒ ์ฌ์ฉ์ ํ๋๊ฐ? (0) | 2023.04.16 |
---|---|
[Github]Git Bash๋ฅผ ์ด์ฉํ clone , add , commit , push(๊ธฐ์ด) (0) | 2022.10.17 |