๋ฐ์ํ
โพ Github repository(์ดํ repo) ์ฐ๋ ๋ฐ push
์ด๊ธฐ ์ธํ ์ด ์๋ฃ๋๋ฉด Github์ ์ฌ๋ ค์ค๋ค.
๊ทธ๋ฌ๊ณ ๋์ ๋ค๋ฅธ ํ์๋ค์ด ํด๋น repo๋ฅผ clone ๋ฐ๋๋ค.
โญ๏ธmaster์์ ๋ฐ๋ก ์์
ํ๋๊ฒ ์๋๋ผ ๋ฐ๋์ branch๋ฅผ ์๋ก ์์ฑํ๊ณ ์์ํ ๊ฒ!
๐๐ป Master๊ฐ ์ฌ๋ฆฌ๋ ๋ฒ
// ์ด๊ธฐ์ธํ
์์
์๋ฃ ํ add ๐๐ป commit
$ git add .
$ git commit -m "[Add] : first commit. ์ด๊ธฐ ์ธํ
์๋ฃ."
// ์ค์นํ CRA ํ๋ก์ ํธ์ github repo๋ฅผ ์ฐ๋์์ผ์ค๋ค.
$ git remote add origin https://github.com/wecode-bootcamp-korea/22-React-Westagram-1.git (ํด๋น repo ์ฃผ์ ์
๋ ฅ)
// ์ฐ๋๋ repository๋ก push ํ๋ค.
$ git push origin master
๐๐ป ํ์๋ค์ด Master branch๋ฅผ clone ๋ฐ๋ ๋ฒ
// 1. clone์ ๋ฐ์ ๊ฒฝ๋ก๋ก ์ด๋ํด์ github repo ์ฃผ์ ๋ณต์ฌํ๊ณ clone ๋ฐ๋๋ค. (๋ณธ์ธ์ desktop์ ๋ฐ์)
$ git clone https://github.com/wecode-bootcamp-korea/22-React-Westagram-1.git
// 2. clone ๋ฐ์ ๋๋ ํ ๋ฆฌ๋ก ์ด๋ํ๋ค.
$ cd 22-React-Westagram-1
// 3. npm install์ ํด์ node-modules ํด๋๋ฅผ ์์ฑํ๋ค.
$ npm install
// 4. feature/yunkyung์ด๋ผ๋ branch๋ฅผ ๋ง๋ ๋ค.
$ git branch feature/yunkyung
// 5. checkout์ผ๋ก branch๋ฅผ ์ ํํด์ค๋ค.
$ git checkout feature/yunkyung
// 6. ํ์ฌ ๋ด๊ฐ ์์นํ branch๋ฅผ ํ์ธํด์ค๋ค.
$ git branch
๐๐ป ํ์ ๊ฐ์์ branch๋ก push ํ๋ ๋ฒ
// 1. ๋จผ์ branch ์์น๋ฅผ ํ์ธํ๋ค.
$ git branch
// 2. ์์ฑํ ์์ค์ฝ๋๋ฅผ ์ถ๊ฐํ๋ค.
$ git add .
// 3. git์ ์ฐ๊ฒฐํ๋ค.
$ git remote -v
// 4. commitํ๋ค. ๋ฉ์ธ์ง๋ ์ ์ด์ค๋ค.
$ git commit -m ""
// 5. ๋์ branch์ push ํด์ค๋ค. (์ ๋ master๋ก push ใดใด์ผ)
$ git push origin feature/yunkyung
๐๐ป Master์์ ๋ณ๊ฒฝ์ฌํญ์ด ์์ ์ ๊ฐ์ branch๋ก pull ๋ฐ๋ ๋ฒ
// 1. ์ง๊ธ ํ์ฌ branch์์ ์์
ํ ๊ฒ๋ค์ add์ commit ๊น์ง ํด์ค๋ค.
$ git add .
$ git commit
// 2. master branch๋ก checkout ํด์ค๋ค.
$ git checkout master
// 3. git pull origin ๋ช
๋ น์ด๋ก ์ต์ ํ ํด์ค๋ค.
$ git pull origin
// 4. ๋ค์ checkout ํด์ ๋ด branch๋ก ๋์์จ๋ค.
$ git checkout feature/yunkyung
// 5. git merge master ๋ช
๋ น์ด๋ก ๋ด branch๋ ํ์ฌ local branch์ฒ๋ผ ์ต์ ํ ํด์ค๋ค!
$ git merge master
๐๐ป ๋ค๋ฅธ ์ปดํจํฐ์์ ์์ ํด์ push ํ ๊ฒ์ ํ์ฌ ์ปดํจํฐ์ pull ํ๊ธฐ
$ git pull origin feature/yunkyung
๐ฅ git log ๋ก ๊ผญ ํ์ธํด ์ค ๊ฒ!!!!!!
๋ฐ์ํ
'Git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Git] Git์ด๋? (0) | 2021.11.18 |
---|---|
[Git] ์์ฃผ ์ฌ์ฉํ๋ ๋ช ๋ น์ด (0) | 2021.11.18 |
branch ์ด๋ฆ ๋ณ๊ฒฝ ํ๋ ๋ฒ (0) | 2021.11.16 |
[Git] commit ๋ฉ์ธ์ง ์์ ํ๋ ๋ฒ (0) | 2021.11.10 |
[Git] commit ๋ฉ์ธ์ง ๋ฃ๊ธฐ ์ซ์ ๋ (0) | 2021.11.10 |
๋๊ธ