2026-01-24

git add로 변경사항 준비

스테이징 영역에 파일을 올리는 git add 흐름을 정리합니다.

Rhio Kim

Rhio Kim

CEO

#git#add#staging

Page reactions

Leave a quick reaction to this shorts.

반응을 불러오는 중...

!!steps

!duration 200

git

_10
# sum.js 파일 생성
_10
$ echo "function sum(a, b) { return a + b; }" > sum.js

내용은 표시가 되지 않습니까?

!!steps

!duration 300

git

_16
# sum.js 파일 생성
_16
$ echo "function sum(a, b) { return a + b; }" > sum.js
_16
_16
# 파일 상태 확인 및 결과
_16
$ git status
_16
On branch main
_16
_16
No commits yet
_16
_16
Untracked files:
_16
(use "git add <file>..." to include in what
_16
will be committed)
_16
sum.js
_16
_16
nothing added to commit but untracked files
_16
present (use "git add" to track)

!!steps

!duration 200

git

_16
# 파일 상태 확인 및 결과
_16
$ git status
_16
On branch main
_16
_16
No commits yet
_16
_16
Untracked files:
_16
(use "git add <file>..." to include in what
_16
will be committed)
_16
sum.js
_16
_16
nothing added to commit but untracked files
_16
present (use "git add" to track)
_16
_16
# 파일 추가 (git add)
_16
$ git add sum.js

!!steps

!duration 300

git

_12
# 파일 추가 (git add)
_12
$ git add sum.js
_12
_12
# 파일 상태 확인 및 결과
_12
$ git status
_12
On branch main
_12
_12
No commits yet
_12
_12
Changes to be committed:
_12
(use "git restore --staged <file>..." to unstage)
_12
new file: sum.js

!!steps

!duration 200

git

_15
# 파일 추가 (git add)
_15
$ git add sum.js
_15
_15
# 파일 상태 확인 및 결과
_15
$ git status
_15
On branch main
_15
_15
No commits yet
_15
_15
Changes to be committed:
_15
(use "git restore --staged <file>..." to unstage)
_15
new file: sum.js
_15
_15
# 변경사항 커밋
_15
$ git commit -m "Add sum.js with sum function"

!!steps

!duration 400

git

_20
# 파일 상태 확인 및 결과
_20
$ git status
_20
On branch main
_20
_20
No commits yet
_20
_20
Changes to be committed:
_20
(use "git restore --staged <file>..." to unstage)
_20
new file: sum.js
_20
_20
# 변경사항 커밋
_20
$ git commit -m "Add sum.js with sum function"
_20
_20
# 커밋 기록 확인 및 결과
_20
$ git log
_20
commit abc1234 (HEAD -> main)
_20
Author: Your Name <your.email@example.com>
_20
Date: Mon Oct 2 12:00:00 2023 +0000
_20
_20
Add sum.js with sum function