ios 创建新项目时,Xcode 4 项目导航器中的“M”和“A”图标是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8863683/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What do the "M" and "A" icons in the Project Navigator of Xcode 4 mean when I create a new project?
提问by Proud Member
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.
Xcode 4 在项目导航器中我的文件旁边显示灰色的“M”和“A”图标。我相信它们与源代码控制有关。
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.
重点是:我在 Xcode 4 中打开和编辑的所有旧 Xcode 3 项目都没有显示这些图标!我在 Xcode 4 中创建的新项目也不受源代码控制。
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.
当我创建项目时,我取消了“Git”选项。但是 Xcode 在单击文件时仍会在检查器中向我显示“源代码管理”信息。最初由项目模板创建的所有文件都标记为“已提交”,而我自己添加的所有文件都没有。因此,要么 Xcode 忽略了我不使用 Git 的愿望,要么它是一个错误,或者两者兼而有之。
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:
更新:有些人建议删除 .git 文件夹。由于它以点开头,因此它可能是一个隐藏文件夹,因此我在终端中使用此技巧在 Finder 中显示隐藏文件:
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.
但是,我的项目文件夹中似乎没有 .Git 文件夹(检查所有包含文件夹)。但是,即使禁用了 Git 复选框,Xcode 仍将我的新项目置于源代码控制之下。
How can I get rid of it if I don't want to use source control yet?
如果我还不想使用源代码管理,我该如何摆脱它?
采纳答案by wadesworld
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.
正如其他人所说,它们与源代码控制有关。如果您确定没有 .git 或 .svn 目录出现在您的项目中并且它们仍然出现,那么这只是一个 Xcode 错误。忽略它或向 Apple 提交错误。
On a side note, you SHOULD be using source control.
附带说明一下,您应该使用源代码控制。
回答by Moin Shirazi
Those characters refer to the source control.
这些字符指的是源代码管理。
- ? - Unversioned
- M - Modified
- A - Added
- A+ - Moved / renamed
- U - Newer version of a file on source control
- I - Item is being ignored (e.g. with the svn:ignore property).
- ! - Item is missing (e.g. you moved or deleted it without using svn). This also indicates that a directory is incomplete (a checkout or update was interrupted).
- ? - 未版本化
- M - 修改
- A - 添加
- A+ - 移动/重命名
- U - 源代码管理文件的较新版本
- I - 项目被忽略(例如使用 svn:ignore 属性)。
- !- 项目丢失(例如,您在没有使用 svn 的情况下移动或删除了它)。这也表明目录不完整(签出或更新被中断)。
Ref:http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.status.html
参考:http : //svnbook.red-bean.com/en/1.2/svn.ref.svn.c.status.html
回答by edc1591
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.
“M”表示自上次提交以来该文件已被修改,“A”表示自上次提交以来该文件已被添加。
If you're using git, you can remove source control by deleting the .git directory in your project folder.
如果您使用的是 git,则可以通过删除项目文件夹中的 .git 目录来移除源代码管理。
回答by ScottyBlades
This is taken from Sam's Book. I am having trouble finding information in Xcode Documentation.
这是取自山姆的书。我在 Xcode 文档中找不到信息。
回答by Tim Dean
The "M" is for "modified" and the "A" is for added. These values reflect the version control state of the files
“M”代表“修改”,“A”代表添加。这些值反映了文件的版本控制状态
回答by Jayprakash Dubey
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 Modifiedwhereas "A"for file Added.
Xcode 中文件旁边的诸如“M”或“A”之类的标签表示您的项目在 SVN/GIT repository 下。“M”表示修改的文件内容,而“A”表示添加的文件。
It is recommended to keep your project under SVN/GIT provision.
建议将您的项目保持在 SVN/GIT 配置下。
回答by Proud Member
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:
如果您发现即使在创建新项目时没有选中“Git”复选框也会出现这些图标,并且如果您确定您的项目并未真正受源代码控制,那么只需执行以下操作:
Restart Xcode, and the issue is gone for your project. The icons disappear and everything is fine :-)
重新启动 Xcode,您的项目问题就消失了。图标消失了,一切都很好:-)
It's a weird Xcode Bug.
这是一个奇怪的 Xcode 错误。
回答by mattjgalloway
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.
我猜您在创建项目时选择了创建本地 git 存储库。它们确实与源代码控制有关,它们的意思是“修改”和“添加”。他们没有为您的旧项目显示的原因是因为您没有对它们使用源代码管理,但就像我说的那样,我认为您在创建项目时选择了创建本地 git 存储库。
回答by tomsoft
And if you use subversion, this is of course related to it, so remove .svn directories
如果你使用 subversion,这当然是相关的,所以删除 .svn 目录
回答by Leander
The icons are always there in XCode 4.5, version control or not
图标始终存在于 XCode 4.5 中,版本控制与否