티스토리 뷰
728x90

git init
git add .
git commit
git log
git status
git restore --staged README.md
git status
git remote add https://~
git remote -v
git branch -m master main
git push -u origin main
git push --set-upstream origin main
로컬저장소에 있는 브랜치와 원격저장소에 있는 브랜치를 연결하는 명령어
git fetch
git pull
git branch --set-upstream-to=origin/main main
git pull
git push
git checkout -b feature/#1
git push origin feature/#1
git branch --set-upstream-to=origin/feature/#1 feature/#1
git push
Fast-forward
- 현재 브랜치; feature/#1
1. git checkout main
2. git merge feature/#1
3. git add .
4. git commit
5. git push origin main
merge commit
- 현재 브랜치; feature/#2
1. git merge main
2. 충돌이 발생했을 경우, 문제를 해결하고 그렇지 않다면 skip
3. git add .
4. git commit
5. git push
6. git checkout main
7. git merge feature/#2
8. git push origin main
rebase
1. git rebase feature/#1 (베이스로 지정할 브랜치명)
2. 만약 충돌이 발생하면 로그가 발생하고 그렇지 않은 경우는 바로 Rebase가 된다.
3. 만약 충돌이 발생했다면, Conflict 발생한 소스 코드를 수정 후, commit
git add .
git commit -m "FIX: conflict HealthController"
4. 중지된 Rebase를 계속 진행; git rebase --continue
5. 최종결과; 깔끔한 커밋 히스토리 유지
- 현재 브랜치; feature/#1
- feature/#1 -> feature/#2 -> main으로 merge하기
git stash
git pull
git checkout feature/#2
git merge feature/#1
git add .
git commit -m "MERGE: conflict"
git checkout main
git merge feature/#2728x90
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- jsx
- 애견동반여행
- 티스토리챌린지
- 랜딩페이지
- 법인영업
- 마크다운
- 오블완
- 깃허브
- HTML
- solidity
- 코틀린
- redis
- 파이썬
- 블록체인
- 타입스크립트
- 해시노드
- pushgateway
- prometheus
- 부트스트랩
- 스프링부트
- Ta
- django
- postgres
- CSS
- react
- grafana
- 리액트
- 보험
- 자바스크립트
- 자바
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함