.gitignore与iOS项目无法正常工作

时间:2015-06-30 14:23:09

标签: git github

这种情况正在发生,我无法理解为什么

int count5 = data.Count(x => x == "5");

string[] data2 = new string[data.Length + count5];

for (int i = 0, j = 0; i < data.Length; i++, j++)
{
    if (data[i] == "5")
    {
        data2[j] = "";
        j++;
    }

    data2[j] = data[i];
}

该文件位于User-MBP:Project user$ git status On branch playlist Your branch is ahead of 'origin/playlist' by 1 commit. (use "git push" to publish your local commits) Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist modified: Project/TPSettings.plist no changes added to commit (use "git add" and/or "git commit -a") User-MBP:Project user$ cat .gitignore SubModules/ .DS_Store Project.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist User-MBP:Project user$ ,因此它不应该告诉我提交该文件。

1 个答案:

答案 0 :(得分:5)

这种情况正在发生,因为有问题的文件已经在源代码管理中。您可以使用git rm --cached myFile.txt删除它们。在那之后,他们确实会被忽视。但需要注意的是:在推送更改后拉出回购的其他人将在工作目录中删除所述文件的本地副本,因此他们可能希望先备份。