“M”是什么意思?和“A” Xcode 4 的项目导航器中的图标在我创建新项目时意味着什么?
Xcode 4 在项目导航器中的文件旁边显示灰色的“M”和“A”图标。我相信它们与源代码控制有关。
重点是:我在 Xcode 4 中打开和编辑的所有旧 Xcode 3 项目都不显示这些图标!我在 Xcode 4 中创建的新项目也不受源代码控制。
当我创建项目时,我取消选中“Git”选项。但当单击文件时,Xcode 仍然在检查器中向我显示“源代码控制”信息。项目模板最初创建的所有文件都被标记为“已提交”,而我自己添加的所有文件都没有标记为“已提交”。因此,要么 Xcode 忽略了我不使用 Git 的愿望,要么它是一个错误,或者两者兼而有之。
更新:有些人建议删除 .git 文件夹。由于它以点开头,因此可能是一个隐藏文件夹,因此我在终端中使用此技巧使隐藏文件在 Finder 中可见:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
但是,我的项目文件夹中似乎没有 .Git 文件夹(检查了所有包含文件夹)。但尽管 Git 复选框被禁用,Xcode 仍然将我的新项目置于源代码控制之下。
如果我还不想使用源代码管理,如何摆脱它?
Xcode 4 is showing me grey "M" and "A" icons next to my files in the project navigator. I believe they're related to source control.
The point is this: All my old Xcode 3 projects opened and edited in Xcode 4 don't show these icons! My new project which I created in Xcode 4 isn't under source control either.
When I created the project I unchecked the "Git" option. But Xcode still shows me a "Source Control" info in the inspector when clicking on a file. All files initially created by the project template are marked as "committed" where as all files I add myself are not. So either Xcode ignored my wish not to use Git or it's a bug, or both.
Update: Some recommend deleting the .git folder. Since it starts with a dot it's probably a hidden folder, and therefore I made hidden files visible in Finder using this trick in Terminal:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
However, it appears that there is NO .Git folder in my project folder (checked all containing folders). But still, Xcode is putting my new projects under source control even though the Git checkbox is disabled.
How can I get rid of it if I don't want to use source control yet?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
这些字符指的是源代码控制。
参考: http: //svnbook.red-bean.com/en/1.2/svn.ref.svn.c.status.html
Those characters refer to the source control.
Ref: http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.status.html
是的,这与源代码控制有关。
“M”表示自上次提交以来该文件已被修改,“A”表示自上次提交以来该文件已被添加。
如果您使用 git,则可以通过删除项目文件夹中的 .git 目录来删除源代码管理。
Yes, it is related to source control.
"M" means the file has been modified since the last commit, and "A" means the file has been added since the last commit.
If you're using git, you can remove source control by deleting the .git directory in your project folder.
这取自山姆的书。我在 Xcode 文档中查找信息时遇到问题。
This is taken from Sam's Book. I am having trouble finding information in Xcode Documentation.
正如其他人所说,它们与源代码控制有关。如果您已确保项目中没有 .git 或 .svn 目录出现,但它们仍然出现,那么这只是 Xcode 错误。忽略它或向 Apple 提交错误。
顺便说一句,您应该使用源代码管理。
As others have said, they're related to source control. If you've made sure that no .git or .svn directories appear in your project and they still show up, then it's just an Xcode bug. Ignore it or file a bug with Apple.
On a side note, you SHOULD be using source control.
“M”代表“修改”,“A”代表添加。这些值反映了文件的版本控制状态
The "M" is for "modified" and the "A" is for added. These values reflect the version control state of the files
正如其他开发人员指出的那样,这些图标代表在源代码控制下添加/修改的文件。
如果您遇到这些图标,即使您在创建新项目时没有选中“Git”复选框,并且您确定您的项目并未真正处于源代码控制之下,那么只需执行以下操作:
重新启动Xcode,您的项目的问题就消失了。图标消失了,一切都很好:-)
这是一个奇怪的 Xcode Bug。
Those icons stand for Added / Modified files under source control, like other devs pointed out.
If you're experiencing that these icons appear even if you did not check the "Git" checkbox when creating a new project, and if you're sure your project is not really under source control, then just do this:
Restart Xcode, and the issue is gone for your project. The icons disappear and everything is fine :-)
It's a weird Xcode Bug.
Xcode 中文件旁边的“M”或“A”等标签表示您的项目位于 SVN/GIT 存储库下。 “M”表示文件修改的内容,而“A”表示文件添加的内容。
建议将您的项目保留在 SVN/GIT 下。
Tags such as "M" or "A" next to files in Xcode indicates that your project in under SVN/GIT repository. "M" indicates content of file Modified whereas "A" for file Added.
It is recommended to keep your project under SVN/GIT provision.
我猜你在创建项目时选择了创建本地 git 存储库。它们确实与源代码控制有关,它们的意思是“修改”和“添加”。它们没有在您的旧项目中显示的原因是因为您没有对它们使用源代码管理,但就像我说的,我认为您在创建项目时选择了创建本地 git 存储库。
I'm guessing you opted to create a local git repository when you created the project. They are indeed related to source control and they mean "Modified" and "Added". The reason they're not showing for your old projects will be because you're not using source control with them, but like I say, I reckon you opted to create a local git repository when you created the projects.
而如果你使用subversion,这当然与之相关,所以删除.svn目录
And if you use subversion, this is of course related to it, so remove .svn directories
无论是否有版本控制,图标在 XCode 4.5 中始终存在
The icons are always there in XCode 4.5, version control or not
很高兴有人能够澄清不同源代码控制状态的含义。
现在,具体针对您关于“!”的问题。标识符,您可能已将文件移至 Xcode 之外。因此,即使它们没有“丢失”,它们也会被 Xcode 识别为未经授权而发生更改。
要让 Xcode 接受更改的源文件,请进行提交。然而,Xcode 将明确不选择标有 ! 的文件。用于提交。您会注意到所有文件的左侧都有一个可用的复选框。如果您确实打算在 Xcode 之外更改文件,请选择这些文件并提交它们。你会发现!符号随后被删除。
It's great to have folks provide clarification on the meaning of the different source control status.
Now, specific to your question about the "!" identifier, it is likely that you had moved files outside of Xcode. So, even if they are not 'missing', they will be identified as having changed without purview by Xcode.
To get Xcode to accept the changed source files, do a commit. HOWEVER, Xcode will specifically not select files marked with ! for commit. You will notice to the left of all files that there is a checkbox available. If you did indeed intend for the files to be altered outide of Xcode, then select these and commit them. You will find that the ! symbol is removed afterwards.