백지부터 시작하는 이세계 코딩 생활
git stash , git pull, git stash pop, git add 본문
git pull 과정에서 충돌로 인해 원할한 Merge가 이뤄지지 않을 때 해결 순서 정리
1. git stash
2. git pull 또는 git pull [원격저장소 이름]
3. git stash pop
2번과 3번 과정에서 생기는 일들은 gid add 로 처리할 수 있다.
- git add [추가하려는 파일 이름] : 특정 파일을 commit 가능한 상태로 추가.
- git add . : 명령어를 실행한 디렉토리 이하에서 발생한 변경내용만 포함하여 추가.
- git add -A : 작업 디렉토리 위치와 무관하게 모든 변경사항을 추가.
----
* git stash 처리를 하는 과정 중에 에러가 발생했을 경우.
enkins@fit-ada-kr-release-210604:/service/server/jenkins/server_lookup$ git stash
Saved working directory and index state WIP on release: cdb7048 git commit test
HEAD is now at cdb7048 git commit test
jenkins@fit-ada-kr-release-210604:/service/server/jenkins/server_lookup$ git pull
Auto-merging server/bin/www
CONFLICT (content): Merge conflict in server/bin/www
Automatic merge failed; fix conflicts and then commit the result.
jenkins@fit-ada-kr-release-210604:/service/server/jenkins/server_lookup$ git checkout -- www " to discard changes in working directory
>
>
>
>
> ^C
jenkins@fit-ada-kr-release-210604:/service/server/jenkins/server_lookup$
이와 같은 현상이 발생하였고.
git commit -am <'commit message'> 이후 git pull 하여 해결하였다.
Ref.
ㅁ git 기본 명령어 모음 정리
https://velog.io/@grinding_hannah/Git-Git-%EC%82%AC%EC%9A%A9%EB%B2%95-%EB%B0%8F-%ED%84%B0%EB%AF%B8%EB%84%90-%EB%AA%85%EB%A0%B9%EC%96%B4-%EC%A0%95%EB%A6%AC
ㅁ git add 개요 및 사용법 정리
https://www.daleseo.com/git-add/
ㅁ git pull 충돌시 해결방법 정리 1
https://jybaek.tistory.com/389
ㅁ git pull 충돌시 해결방법 정리 2 (1의 경우에서 트러블이 발생했을 때 참고)
https://velog.io/@2ujin/%EA%B9%83-Pull-is-not-possible-because-you-have-unmerged-files-%EC%97%90%EB%9F%AC
'Git desktop' 카테고리의 다른 글
git Merge 하기 (0) | 2021.04.20 |
---|
Comments