最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]Xcode中如何删除Source Control中的无用的Working Copies列表

Xcode crifan 5732浏览 0评论

虽然已经:

[基本解决]Xcode提交本地导入的代码到远程服务器时出错:Multiple working copies failed to commit files

但是还是想要删除:

Source Control中的Working Copies列表

然后配置中,又出现了:

Repositories的列表:

即:

之前已经删除了那么一堆的git的repository,结果重启Xcode后又出现了。。。

搜:

Xcode how delete working copies

git – How to disassociate working copy of an Xcode 5 project from SVN server that died – Stack Overflow

git – detach all working copies and reset all version history in Xcode 6.3 – Stack Overflow

Xcode Source Control showing multiple Working Copies – Stack Overflow

关闭Xcode

去试试

对应路径是:

JianDao.xcodeproj/project.xcworkspace/xcshareddata/JianDao.xcscmblueprint

看到文件内容中包含对应的git仓库信息:

{
  "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "66DAA658BA8189CD2ACB6109F0F902E6931B573D",
  "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
    "ab9b9a52-993a-f7e8-1a3a-ac29c5278e3c++5431" : {
    }
  },
  "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
    "ab9b9a52-993a-f7e8-1a3a-ac29c5278e3c++5431" : 0,
    "F03E09D7108B6B558326B4A7FA105E304FD0FE55" : 0,
    "E4BCE3AE6B24E41B9BCE312FF3B0B6CD0B8B8025" : 0,
    "38C2A0D4F62B675E8C16C8BC1437C7753846C8AC" : 0,
    "30ADC0B4C75B58EEF37C84892DC087AB86322B2F" : 0,
    "02184E68B235AB5A28EE74C3C5F144D3ADA9DCF2" : 0,
    "A20D666FF4B08EFE53F147818C2D4D17E2242912" : 0,
    "B775552D1BBEEADC6A0BBB2FD048B6AA26CB309D" : 0,
    "DD20A1A48C66B5213E0FEBB87A95EF51D6C6F3E8" : 0,
    "66DAA658BA8189CD2ACB6109F0F902E6931B573D" : 0
  },
  "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "9176CD5B-928A-4D4A-8FB5-5B0A6F0641DF",
  "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
    "ab9b9a52-993a-f7e8-1a3a-ac29c5278e3c++5431" : "..\/..\/chantyou\/projects\/schoolike\/ios\/code\/ios",
    "F03E09D7108B6B558326B4A7FA105E304FD0FE55" : "..\/..\/..\/dev_src\/swift\/XMPP\/SwiftXMPP\/git\/SwiftXMPP\/XMPPFramework\/Vendor\/facebook-ios-sdk\/vendor\/OCHamcrest",
    "E4BCE3AE6B24E41B9BCE312FF3B0B6CD0B8B8025" : "..\/..\/..\/dev_src\/swift\/XMPP\/SwiftXMPP\/git\/SwiftXMPP\/XMPPFramework\/Vendor\/facebook-ios-sdk\/vendor\/OCMock",
    "38C2A0D4F62B675E8C16C8BC1437C7753846C8AC" : "..\/..\/..\/dev_src\/swift\/XMPP\/SwiftXMPP\/git\/SwiftXMPP\/XMPPFramework\/Vendor\/facebook-ios-sdk\/vendor\/OHHTTPStubs",
    "30ADC0B4C75B58EEF37C84892DC087AB86322B2F" : "..\/..\/..\/dev_src\/swift\/XMPP\/SwiftXMPP\/git\/SwiftXMPP",
    "02184E68B235AB5A28EE74C3C5F144D3ADA9DCF2" : "..\/..\/..\/dev_src\/swift\/XMPP\/SwiftXMPP\/git\/SwiftXMPP\/XMPPFramework\/Vendor\/facebook-ios-sdk\/vendor\/OCHamcrest\/Source\/XcodeCoverage",
    "A20D666FF4B08EFE53F147818C2D4D17E2242912" : "..\/..\/..\/dev_src\/swift\/XMPP\/SwiftXMPP\/git\/SwiftXMPP\/XMPPFramework\/Vendor\/facebook-ios-sdk",
    "B775552D1BBEEADC6A0BBB2FD048B6AA26CB309D" : "..\/..\/..\/dev_src\/swift\/XMPP\/SwiftXMPP\/git\/SwiftXMPP\/XMPPFramework",
    "DD20A1A48C66B5213E0FEBB87A95EF51D6C6F3E8" : "..\/..\/..\/dev_src\/swift\/XMPP\/SwiftXMPP\/git\/SwiftXMPP\/XMPPFramework\/Vendor\/facebook-ios-sdk\/vendor\/OHHTTPStubs\/OHHTTPStubs\/UnitTests\/AFNetworking",
    "66DAA658BA8189CD2ACB6109F0F902E6931B573D" : "iOS-Client\/"
  },
  "DVTSourceControlWorkspaceBlueprintNameKey" : "JianDao",
  "DVTSourceControlWorkspaceBlueprintVersion" : 204,
  "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "JianDao\/JianDao.xcodeproj",
  "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git:\/\/github.com\/jonreid\/XcodeCoverage.git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "02184E68B235AB5A28EE74C3C5F144D3ADA9DCF2"
    },
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/nemesit\/SwiftXMPP.git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "30ADC0B4C75B58EEF37C84892DC087AB86322B2F"
    },
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git:\/\/github.com\/AliSoftware\/OHHTTPStubs.git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "38C2A0D4F62B675E8C16C8BC1437C7753846C8AC"
    },
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/git.oschina.net\/windoze\/iOS-Client.git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "66DAA658BA8189CD2ACB6109F0F902E6931B573D"
    },
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git:\/\/github.com\/facebook\/facebook-ios-sdk.git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "A20D666FF4B08EFE53F147818C2D4D17E2242912"
    },
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/robbiehanson\/XMPPFramework.git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B775552D1BBEEADC6A0BBB2FD048B6AA26CB309D"
    },
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "http:\/\/github.com\/AFNetworking\/AFNetworking.git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "DD20A1A48C66B5213E0FEBB87A95EF51D6C6F3E8"
    },
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git:\/\/github.com\/erikdoe\/ocmock",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E4BCE3AE6B24E41B9BCE312FF3B0B6CD0B8B8025"
    },
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git:\/\/github.com\/hamcrest\/OCHamcrest",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "F03E09D7108B6B558326B4A7FA105E304FD0FE55"
    },
    {
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/vip.svnspot.com\/cyydev.schoolike",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion",
      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "ab9b9a52-993a-f7e8-1a3a-ac29c5278e3c++5431"
    }
  ]
}

然后删除掉其中不需要的部分。

然后保存。

重新用Xcode打开项目。

再去Source Control中,果然没了那些无用的Working Copies:

再去设置中看看:

果然也没了,只剩有用的了:

[总结]

Xcode中,之前访问过的git和svn的repository,即使你在配置中删除了之后,Source Control中还存在相应的列表。

想要彻底删除,可以:

右击xxx.xcodeproj-》打开包内容-》project.xcworkspace,右击-》打开包内容-》xcshareddata-》用文本编辑器打开xxx.xcscmblueprint

注:完整地址是:

xxx.xcodeproj/project.xcworkspace/xcshareddata/xxx.xcscmblueprint

-》删除:

"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [{xxx},{xxx}]

中的:{xxx},对应着你的git或svn的仓库地址,一看就能看懂。

删除后,保存文件。

重新用Xcode打开,即可看到Source Control或Xcode的设置-》Accounts-》Repositories中已经没了对应的垃圾gti或svn地址列表了。

[后记]

之后,再有代码修改,再去commit,就可以看到:

Push to remote: origin/master

了。

转载请注明:在路上 » [已解决]Xcode中如何删除Source Control中的无用的Working Copies列表

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.204 seconds, using 22.12MB memory