2016-07-26 7 views
2

메인 저장소에 third-party이라는 하위 모듈이 있습니다. 이 모듈이 너무 크기 때문에 내 작업 공간에 third-party 폴더에 대한 심볼릭 링크를 만들었습니다. 불행하게도, 큰 지문 병합의 일환으로이 지칭 링크를 내 지사에 투입했습니다! 기본적으로, 저는 서브 모듈을 심볼릭 링크로 대체했습니다.힘내 : 서브 모듈을 교체 한 심볼릭 링크 커밋을 되돌리려면?

링크 및 하위 모듈 업데이트를 삭제하려고 시도했지만 도움이되지 않았습니다.

자세한 내용 :

cat .gitmodules는 다음

[submodule "third-party"] 
    path = third-party 
    url = http://my-git-server/third-party.git 

ls -la 내가 어떻게이 상황에서 복구하는 방법 아무 생각 다음

drwxr-xr-x 3 user admin 136 Jul 26 17:57 some-folder 
drwxr-xr-x 3 user admin 102 Jul 26 17:57 third-party -> /some/dead/path 

출력 출력합니다. 어떤 도움이라도 대단히 감사합니다.

답변

1

여러 가지를 시도하고 마지막으로 다음을 시도했습니다. 이 문제를 해결하는 더 좋은 방법은 환영합니다!

#delete the symlink 
rm third-party 

#delete the symlink from git 
git rm third-party 

#remove the submodule 
cat /dev/null>.gitmodules 

#commit the changes 
git add . 
git commit -m "Removing third-party as submodule" 

#add the submodule again 
git add submodule http://my-git-server/third-party.git third-party 

#get the latest code from the submodule 
git submodule update --remote 

내 문제가 해결되었습니다. 제삼자가 지금 가리키고있는 커밋 해시가 다르지만, 내가 git submodule update --remote 일 때, 나는 최신 코드를 얻습니다!

관련 문제