๋ฐ์ํ
git add ์ทจ์ํ๊ธฐ
1. ํ์ผ ์ํ๋ฅผ ํ์ธํ๋ค.
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: index.html
2. git reset HEAD [์ทจ์ํ ํ์ผ๋ช
] ๋ช
๋ น์ด๋ฅผ ์
๋ ฅํ๋ค. ๋ค์ ํ์ผ๋ช
์ด ์์ผ๋ฉด addํ ์ ์ฒด ํ์ผ์ ์ทจ์ํ๋ค.
$ git reset HEAD index.html
3. ๋ค์ ํ์ผ ์ํ๋ฅผ ํ์ธํ๋ค.
$ git status
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: index.html
git commit ์ทจ์ํ๊ธฐ
1. commit ๋ชฉ๋ก์ ํ์ธํ๋ค.
$ git log
2. ์ทจ์ํ๊ณ ์ถ์ commit๋ค์ ์ทจ์ํ๋ค.
$ git reset HEAD~2 (๋ง์ง๋ง 2๊ฐ์ commit์ ์ทจ์)
๋ฐ์ํ
'Git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Git] Git์ด๋? (0) | 2021.11.18 |
---|---|
[Git] ์์ฃผ ์ฌ์ฉํ๋ ๋ช ๋ น์ด (0) | 2021.11.18 |
ํ๋ณ Git ์ฌ์ฉ๋ฒ (0) | 2021.11.17 |
branch ์ด๋ฆ ๋ณ๊ฒฝ ํ๋ ๋ฒ (0) | 2021.11.16 |
[Git] commit ๋ฉ์ธ์ง ์์ ํ๋ ๋ฒ (0) | 2021.11.10 |
๋๊ธ