Git

git2

낮햇볕 2022. 2. 15. 12:21

//merge충돌 html 파일에 git bash
 새로운브런치  두번째 줄에 적음


/HTML (master)
$ git add .

/HTML (master)
$ git commit -m '마스터에서 수정'
[master 7a0adef] 마스터에서 수정
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 "HTML\352\270\260\354\264\210/img/1.jpg"

/HTML (master)
$ git checkout test
Switched to branch 'test'

/HTML (test)
$ git add.        ///잘못적음
git: 'add.' is not a git command. See 'git --help'.

The most similar command is
        add

/HTML (test)
$ git add .   //여기서 또 다르게 txt안에 적었을듯

/HTML (test)
$ git commit -m '마스터에서 수정'
[test 46d5563] 마스터에서 수정
 1 file changed, 1 insertion(+)

/HTML (test)
$ git checkout test
Already on 'test'

/HTML (test)
$ git add .

/HTML (test)
$ git commit -m '마스터에서 수정'        
[test 4587c7a] 마스터에서 수정
 1 file changed, 2 insertions(+), 2 deletions(-)

/HTML (test)
$ git checkout test
Already on 'test'

/HTML (test)
$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

/HTML (master)
$ git merge test
Auto-merging 새로운브런치에서수정.txt
CONFLICT (content): Merge conflict in 새로운브런치에서수정.txt
Automatic merge failed; fix conflicts and then commit the result.

/HTML (master|MERGING)
$ git commit -m '충돌수정'
error: Committing is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
U       새로운브런치에서수정.txt

text를 키면 이게 나올것임 그럼 head부분지우고 test부분만 둔다 >>>>도 지우고



/HTML (master|MERGING)
$ git add .

/HTML (master|MERGING)
$ git commit -m '충돌수정'
[master 2aa6ca0] 충돌수정



 

// git merge test
Auto-merging 새로운브런치에서수정.txt
CONFLICT (content): Merge conflict in 새로운브런치에서수정.txt
Automatic merge failed; fix conflicts and then commit the result.
 합치는데 실패함

 (master|MERGING)
합쳐지고 있는 중
충돌되어서 새로운브런치에서 수정파일에 head 와 test가 나오는데 test부분만 두고 head 부분 지워줌 지울테 test도 지워줌
충돌수정 입력전에위에꺼

충돌수정 입력했는데 에러뜸  add하기 그다음커밋하기 gitlog하면나옴


merge 충돌시  프로젝트에서 충돌될수있음 clone이나 pull이용하셈 
1. 충돌된 파일 확인
2. 원하는 코드만 남겨둠
3.git add .
4. git commit -m '충돌수정 코멘트' / /

'Git' 카테고리의 다른 글

Netlify 사용  (0) 2022.10.05
깃page배포 npm run deploy 사용  (1) 2022.10.05
git  (0) 2022.02.15
깃 bash 사용하기  (0) 2022.02.14