저는 신세를졌습니다. 이전 파일을 삭제하고 새 파일을 추가하는 등 많은 코드 이동이 관련된 지점에서 작업하고있었습니다. 따라서 실제로 병합하기 전에 자식 병합의 드라이 실행하기로 결정 : `git reset` 어떻게해야합니까?`git merge --no-commit --no-ff`
나는git merge --no-commit --no-ff <myBranchName>
을 달렸다. 이걸 실행 한 후에 충돌이 일어났습니다. 그럼 난 자식 상태 및 결과가 있었다 않았다 :
My-Macbook-pro:[master] $ git status
# On branch master
# You have unmerged paths.
# (fix conflicts and run "git commit")
#
# Changes to be committed:
# modified: common/TP.php
# deleted: common/model/Job/Request.php
# new file: common/DP.php
#
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: .gitignore
# both added: build/release/current/production.sql
# deleted by them: common/Service/DFPASPAdapter.php
# both modified: common/Ze.php
# deleted by them: common/model/provider/DFPASP.php
다음 (때문에 git merge
드라이 런으로 발생하는) git add
을 취소, 나는 git reset HEAD
을 달렸다. 하지만 실현 이후에/무대에 다시 얻기 위해 마스터 분기에 병합하기 전에 (즉, 정확히 같은 마스터하기 위해 최선을 다하고 있습니다 무엇으로), 나는 하드 리셋을 실행 한 후 git reset --hard HEAD
를 실행해야합니다, git status
것을 배웠다
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# build/release/current/upgrade.php
# common/F1.php
# common/F2.php
# common/F3.php
nothing added to commit but untracked files present (use "git add" to track)
위의 파일 F1, F2, F3 및 upgrade.php는 내가 작업중인 지점에 추가되었습니다. git reset --hard HEAD
을 사용하면 master
브랜치가 내가 병합하려고하는 브랜치와 관련된 모든 것을 잊어 버리게되기를 바랬습니다 (드라이 런).
이것이 가능한 것입니까? 개념에 누락 된 것이 있습니까? 그리고 수동으로 파일을 제거하는 유일한 옵션을 남겼습니까? 나를 더 잘 이해하게하는 데 도움이 될 것입니다! 감사합니다.