티스토리 뷰
1. git status : Local Repository 를기준으로 Remote Repository 와 다른파일들을 보여준다. 변경사항들을 체크한다.
Changes not staged for commit - Remote Repository 에 올라가있고 추적이 되있는 파일들, 관리대상인 파일들
Untracked files - Remote Repository에 올라가 있지 않아서 깃이 추적을 하지 않는 파일들, 관리대상이 아닌파일들
ex) gitAddTest2.txt 파일은 로컬에서 생성

2. git add : git commit 전단계로 Remote Repository 에서 해당 파일을 추적한다.
git add * : 변경된 모든파일을 stage 영역으로 변경
ex) git add gitAddTest2.txt 진행후 git status 실행을하면 아래처럼 초록색글씨로 new file : gitAddTest2.txt 로 변경된다.
git add src/main/resource/application.properties 진행후 modified : src/main/resource/application.properties 변경된다.
gitAddTest2.txt 는 완전 새로운 파일이고, application.properties 는 기존에 추가되어있던 파일이면서 변경사항이 있는파일이다.

3. git commit : stage 영역에있는 파일들을 커밋
ex) git commit -m "git Commit Test1" 을 실행 후 git status 실행

4. git push : 위에서 커밋한 2개의 파일을 Remote Repository로 보내게 된다.
ex) git push origin master 실행 후 해당 깃으로 가서 확인해보면 아래처럼 commit 시 입력한 코멘트로 나오게된다.


6. 파일변경 후 git add , git commit
ex) 위에서 사용했던 파일중 gitAddTest2.txt에서 내용을 변경후 git status 로 보게되면 해당 파일이 Change not staged for commit 에 포함되어있다.
그후 git add gitAddTest2.txt 를 실행 후 git status 를 실행하면 gitAddTest2.txt 파일은 Changes to be committed 에 포함되는걸 볼수있다.
이상태에서 commit 을 진행하지 않고 한번도 gitAddTest2.txt 파일의 내용을 변경하면 아래처럼 두영역에 포함된걸 볼수있다.
Changes to be committed : gitAddTest2.txt 내용은 "asdasasdasdasdasaaaa asdadadadasdad"
Changes not staged for commit : gitAddTest2.txt 내용은 "git add 후 change to be commited 로 가있지만 커밋전에 다시 수정해봄" 이다.
이제 commit 진행후 push를하여 결과값을 확인해보면 아래처럼 "asdasasdasdasdasaaaa asdadadadasdad" 이다.
"git add 후 change to be commited 로 가있지만 커밋전에 다시 수정해봄" 내용은 git add 가 진행되지 않아 commit push를해도 변경이 적용되지 않는다.
'Git' 카테고리의 다른 글
git fetch --prune git remote prune origin (0) | 2022.10.24 |
---|---|
Git Bash 를 사용하여 Git Hub Repository 연결 (0) | 2019.12.12 |
eclipse + git - branch 생성 및 master branch 와 Merge(병합) (1) | 2019.07.08 |
eclipse + git 연동 (0) | 2019.07.05 |
- Total
- Today
- Yesterday
- CompositeItemWriter
- Spring Actuator
- tomcat gzip
- quartz 실무 적용
- no `meta.properties` found in
- 배치 관리 ui
- kafka srping event
- cursor ai 프롬프트
- cursorAI
- Spring boot Actuator
- 잡 스케줄링
- cursor ai crud
- 스케줄링 시스템
- Enum ==
- quartz spring batch
- kafka redis
- oubox pattern
- custom Item writer
- SpringBatch 5.1.1
- kafka oubox
- spring security
- Enum equals
- Enum Equals ==
- cursor ai 프로젝트
- actuator prometheus grafana
- spring boot jpa crud
- JdbcBatchItem
- 배치 모니터링
- cursor ai
- spring boot jpa
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |