2011-06-16 65 views
8

我有一個Git倉庫,由於我自己的原因,我想在XCode 4之外進行管理。真的,我想要的是XCode只是讓我的倉庫保持獨立。但是,我注意到XCode會將新項目添加到存儲庫,如果它們保存在存儲庫中。如何阻止XCode 4修改本地Git存儲庫?

例如,假設我開始了一個純醇」回購:

 
mkdir gittest; cd gittest 
git init; touch a; git add a; git commit 

我火了Xcode和創建一個新項目。注:我做而不是有「創建該項目的本地git存儲庫」複選框選中。對於目標目錄,我將它保存到目錄gittest

git status顯示:

 
# On branch master 
# Changes to be committed: 
# (use "git reset HEAD ..." to unstage) 
# 
# new file: gittest/gittest.xcodeproj/project.pbxproj 
# new file: gittest/gittest/en.lproj/InfoPlist.strings 
# new file: gittest/gittest/gittest-Info.plist 
# new file: gittest/gittest/gittest-Prefix.pch 
# new file: gittest/gittest/gittestAppDelegate.h 
# new file: gittest/gittest/gittestAppDelegate.m 
# new file: gittest/gittest/iPad/en.lproj/MainWindow_iPad.xib 
# new file: gittest/gittest/iPad/gittestAppDelegate_iPad.h 
# new file: gittest/gittest/iPad/gittestAppDelegate_iPad.m 
# new file: gittest/gittest/iPhone/en.lproj/MainWindow_iPhone.xib 
# new file: gittest/gittest/iPhone/gittestAppDelegate_iPhone.h 
# new file: gittest/gittest/iPhone/gittestAppDelegate_iPhone.m 
# new file: gittest/gittest/main.m 
# 
# Changed but not updated: 
# (use "git add ..." to update what will be committed) 
# (use "git checkout -- ..." to discard changes in working directory) 
# 
# modified: gittest/gittest.xcodeproj/project.pbxproj 
# 
# Untracked files: 
# (use "git add ..." to include in what will be committed) 
# 
# gittest/gittest.xcodeproj/project.xcworkspace/ 
# gittest/gittest.xcodeproj/xcuserdata/ 

很明顯,Xcode是修改一個Git倉庫,它沒有被告知來管理。

有沒有人遇到過這個?我假設這是一個功能,並有一些偏好禁用它,但對於我的生活,我無法找到它。

+0

公平地說,它只是修改索引。 – 2011-06-16 21:18:22

+0

是的,我想這是事實。儘管如此,它仍然困擾着我。 :( – Tom 2011-06-16 23:52:55

回答

9

我已經經歷過這種煩惱,以及和希望有一種方法來完全禁用它,但只有短期的解決方案,我發現是做到以下幾點:

窗口 - >管理 - >庫

刪除您的倉庫條目,並且IDE不會修改倉庫。每次我打開一個XCode會話時,我都必須這樣做。我希望有人有更好的辦法!

1

對於那些有這個問題和使用xcode 6它更容易。

首選項 - >源代碼控制

,然後取消選擇「啓用源代碼管理」或只是選中Add和「自動刪除文件」。