나는 않았다 git pull
공유 자식 저장소에서,하지만 난 시도 후 뭔가 정말 잘못했습니다 git revert
. 현재 상황은 다음과 같습니다.
$ git stash
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: needs merge
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: needs merge
Utilities/socketxx/socket++/sockstream.cpp: needs merge
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: needs merge
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: needs merge
Utilities/socketxx/socket++/sockstream.cpp: needs merge
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (2aafac967c35fa4e77c3086b83a3c102939ad168)
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (78cc95e8bae85bf8345a7793676e878e83df167b)
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (2524db713fbde0d7ebd86bfe2afc4b4d7d48db33)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (4bb4ba78973091eaa854b03c6ce24e8f4af9e7cc)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (ad0982b8b8b4c4fef23e69bbb639ca6d0cd98dd8)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (4868371b7218c6e007fb6c582ad4ab226167a80a)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (f7a1b386b5b13b8fa8b6a31ce1258d2d5e5b13c5)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (6ce299c416fbb3bb60e11ef1e54962ffd3449a4c)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (75c8043a60a56a1130a34cdbd91d130bc9343c1c)
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: unmerged (79c2843f2649ea9c87fa57662dafd899a5fa39ee)
...
fatal: git-write-tree: error building trees
Cannot save the current index state
모든 것을 재설정하는 방법이 있습니까?
감사
답변
사용하다:
git reset --mixed
대신에 git reset --hard
. 변경 사항이 손실되지 않습니다.
답변
이것은 나를 위해 일했다 :
하다
$ git status
그리고 당신이 가지고 있는지 확인 Unmerged paths
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add <file>..." to mark resolution)
#
# both modified: app/assets/images/logo.png
# both modified: app/models/laundry.rb
그것들 git add
을 각각 수정하고 git stash
다시 시도 하십시오.
git add app/assets/images/logo.png
답변
malat의 응답에 대한 후속 조치를 위해 패치를 작성하여 변경 사항을 유실하지 않고 나중에 다시 적용 할 수 있습니다.
git diff --no-prefix > patch.txt
patch -p0 < patch.txt
안전을 위해 패치를 저장소 폴더 외부에 저장하십시오.
답변
나는 사용했다 :
git reset --hard
나는 약간의 변화를 잃어 버렸지 만 이것은 괜찮습니다.
답변
어쩌면 git 리포지토리에 병합되지 않은 경로가있어서 숨김하기 전에 해결해야합니다.
답변
이것은 변경 사항을 숨기려고 할 때 발생했지만 변경 사항이 지점의 현재 상태와 충돌 했습니다.
그래서 git reset --mixed
git 충돌을 해결하고 다시 해결했습니다.