728x90
git config pull.rebase false
- 리베이스 사용 안 함: 원격 저장소의 변경 사항을 현재 브랜치에 적용할 때 리베이스 대신 병합을 수행합니다.
이는 원격 브랜치의 커밋 히스토리를 그대로 유지하며, 변경 사항을 통합할 때 새로운 병합 커밋이 생성됩니다.
- 명령어: git pull 명령을 사용할 때, 자동으로 --no-rebase 옵션이 적용되는 것과 같습니다.
pull 할 때 rebase를 하지 않고 merge한다.
git config pull.rebase true
pull 할 때 rebase를 한다.
git config pull.ff only
fast-foward 일때만 pull을 허용한다.git config pull.rebase false
1. git config pull.rebase false
2. git pull
3. 다음의 메세지가 나옴 : please enter a commit messag to explain why this merge is necssary
4. 해결방법
- i를 누른다 (commit message를 입력하기 위해)
- merge에 대한 message를 입력한다.
- esc를 누른다.
- :wq를 입력한다.
- enter를 누른다.
5. 이렇게 수정 후 add -> commit -> push 순으로 작업하면 github에는 2개의 커밋이 올라가게 된다.
728x90
'git' 카테고리의 다른 글
error: 레퍼런스를 'https://github.com/ohsoomansour/shoppingmall_front.git'에 푸시하는데 실패했습니다 (0) | 2024.10.06 |
---|---|
git stash 방법 (0) | 2024.06.10 |
다른 컴퓨터 사용시 local branch가 remote branch를 tracking하지 못할 경우 (0) | 2024.06.02 |
git reject 문제 (0) | 2024.01.29 |
Updates were rejected because the tip of your current branch is behind (0) | 2024.01.20 |