Tôi đang cố gắng di chuyển repo git từ Kiln sang Github. Tôi có thể thêm điều khiển từ xa mới tốt, nhưng khi tôi cố gắng đẩy tổng thể để điều khiển từ xa mới, tôi nhận được lỗi sau:Xóa thư mục '.git' khỏi git repo?
Counting objects: 8691, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3000/3000), done.
remote: error: object a9ee490ac00987835de30bdbc851da5e8d45d28b:contains '.git'
remote: fatal: Error in object
error: pack-objects died of signal 13
error: failed to push some refs to '[email protected]:Account/repo.git'
Commit a9ee490ac00987835de30bdbc851da5e8d45d28b
có các tập tin sau đây trong nó:
.git/
CHANGELOG.md
JSONKit.h
JSONKit.m
README.md
Rõ ràng một người nào đó trong quá khứ, sử dụng hg
, được kiểm tra trong một repo git đầy đủ trong một thư mục con.
Tôi muốn xóa hoàn toàn thư mục đó, nhưng đang gặp sự cố khi xóa tệp đó khỏi lịch sử git.
Câu trả lời trong pushing a git repo fails with error: contains '.git' không hữu ích, bởi vì tôi đã làm repo như một repo git, không phải là một một trong những mercurial.
tôi đã cố gắng git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch .git'
, nhưng tôi nhận được lỗi:
Rewrite 7dbd0970d6c79215d11994b4a9b8091b2e954cfb (326/442)error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/HEAD'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/config'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/description'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/hooks/applypatch-msg.sample'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/hooks/commit-msg.sample'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/hooks/post-update.sample'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/hooks/pre-applypatch.sample'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/hooks/pre-commit.sample'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/hooks/pre-rebase.sample'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/hooks/prepare-commit-msg.sample'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/hooks/update.sample'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/index'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/info/exclude'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/logs/HEAD'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/logs/refs/heads/master'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/objects/pack/pack-43fac03d375df5c1e380c5e522ba6bcb9b4e1ec1.idx'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/objects/pack/pack-43fac03d375df5c1e380c5e522ba6bcb9b4e1ec1.pack'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/packed-refs'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/refs/heads/master'
error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/refs/remotes/origin/HEAD'
và lịch sử dường như không được thay đổi. Tôi đang ở giới hạn kiến thức git của tôi. Có ai giúp được không?
Nguồn mở có phải là repo không? bạn có thể chia sẻ một bản sao của nó không? –
Ah, không cần phải chia sẻ một bản sao của repo trong câu hỏi, tôi đã quản lý để xây dựng một kho Git với cùng một loại cây xấu, mà tôi có thể sử dụng cho mục đích thử nghiệm. –
có thể trùng lặp của [đẩy một repo git thất bại với lỗi: chứa '.git'] (http://stackoverflow.com/questions/14728751/pushing-a-git-repo-fails-with-error-contains-git) –