Infra
-
GIT add2022.06.21
-
GIT cherry-pick2022.06.21
-
GIT checkout2022.06.21
-
GIT remote2022.06.21
-
GIT status2022.06.21
GIT add
2022. 6. 21. 21:55
반응형
add (staged area)
- 수정한 파일을 unstaged -> staged 로 이동 (commit 전 실행)
git add --all or add . or add {filename}
git reset HEAD {filename} or 파일명 없을 경우 전체 //staged -> unstaged
반응형
'Infra > git' 카테고리의 다른 글
GIT clean (0) | 2022.06.21 |
---|---|
GIT restore (0) | 2022.06.21 |
GIT cherry-pick (0) | 2022.06.21 |
GIT checkout (0) | 2022.06.21 |
GIT remote (0) | 2022.06.21 |
GIT cherry-pick
2022. 6. 21. 11:37
반응형
cherry-pick
- 다른 브랜치 commit hash 가져오기
git cherry-pick {5775401d}
git cherry-pick f2abff5^..8e2fa35 //범위 지정하여 가져오기 (f2abff5~ 8e2fa35 commit 까지)
반응형
'Infra > git' 카테고리의 다른 글
GIT restore (0) | 2022.06.21 |
---|---|
GIT add (0) | 2022.06.21 |
GIT checkout (0) | 2022.06.21 |
GIT remote (0) | 2022.06.21 |
GIT status (0) | 2022.06.21 |
GIT checkout
2022. 6. 21. 11:33
반응형
checkout
- 작업 중인 branch switch & commit 전환
- 수정 중인 내용 되돌리기 restore
git checkout -t {branch} //특정 브랜치로 이동 (new:-t / 기존:-b)
git checkout . //모든 변경 내용 되돌리기
git checkout {commit hash} //특정 commit 버전으로 전환
반응형
'Infra > git' 카테고리의 다른 글
GIT add (0) | 2022.06.21 |
---|---|
GIT cherry-pick (0) | 2022.06.21 |
GIT remote (0) | 2022.06.21 |
GIT status (0) | 2022.06.21 |
GIT pull (0) | 2022.06.21 |
GIT remote
2022. 6. 21. 11:25
반응형
remote
- 작업 중인 local branch 연결된 저장소 확인
git remote -v
git remote remove origin //연결 삭제
git remote add origin {brach} //신규 연결
- first local branch를 remote 로 push
git init
git remote add origin {git repository}
git add .
git commit -m "initial commit"
git push -u origin master
- remote branch 잘못 올라간 파일 삭제
git rm --cached -r <file or folder> //.gradle
git add .
git push origin master
반응형
'Infra > git' 카테고리의 다른 글
GIT cherry-pick (0) | 2022.06.21 |
---|---|
GIT checkout (0) | 2022.06.21 |
GIT status (0) | 2022.06.21 |
GIT pull (0) | 2022.06.21 |
Git fetch (0) | 2022.06.21 |
GIT status
2022. 6. 21. 11:24
반응형
status
- 작업 중인 local branch 변경 상태 확인
git status
반응형
'Infra > git' 카테고리의 다른 글
GIT checkout (0) | 2022.06.21 |
---|---|
GIT remote (0) | 2022.06.21 |
GIT pull (0) | 2022.06.21 |
Git fetch (0) | 2022.06.21 |
GIT log (0) | 2022.06.21 |