简体   繁体   English

本地git不起作用-Xcode 4.6

[英]Local git not working - Xcode 4.6

I have been having a lot of trouble setting up a local git repository on a project of mine. 我在我的项目上设置本地git存储库时遇到了很多麻烦。 I have created a completely new project and dragged all the files into it, making sure that I checked of the git/version control tick. 我创建了一个全新的项目并将所有文件拖到其中,并确保检查了git / version控件的勾号。

Now I have the repository (with the file system pointing back to the proper location) visible in the organizer, and can use the buttons Pull and Commit all in the organizer: 现在,我在组织者中看到了存储库(文件系统指向正确的位置),可以在组织者中使用“全部PullCommit ”按钮:

在此处输入图片说明

But when I make any changes in the actual project, no source control badges show up ie M , A , etc. even when changes are made. 但是,当我在实际项目中进行任何更改时,即使进行更改,也不会显示源代码控制标志,即MA等。 And when I try to push (or do anything) it says that there are no remotes (there are remotes...): 当我尝试推动(或执行任何操作)时,它说没有遥控器(有遥控器...):

在此处输入图片说明

It seems almost like the project is somehow not actually attached to the repository... 似乎该项目实际上没有以某种方式附加到存储库中...

EDIT: git status in terminal 编辑:终端中的git status

# On branch master
# Your branch is ahead of 'origin/master' 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:   CrunchCalculator-1-2.xcodeproj/project.xcworkspace/xcuserdata/Neil.xcuserdatad/UserInterfaceState.xcuserstate
#   modified:   CrunchCalculator-1-2/ViewController.h
#
no changes added to commit (use "git add" and/or "git commit -a")

After hours restarting, testing, and searching for solutions... turns out all you had to do was change the name of the Project. 经过几个小时的重新启动,测试和搜索解决方案……事实证明,您要做的就是更改项目的名称。 By clicking on the main project folder (blue) and hitting enter, then change the name to something else, this solved the problem. 通过单击主项目文件夹(蓝色)并单击Enter,然后将名称更改为其他名称,这解决了问题。

Changing the name of the project! 更改项目名称!

Instead of using the XCode for GIT use Command line. 不要将XCode用于GIT,而应使用命令行。

This link give you a the usage of various GIT commands git 该链接为您提供了各种GIT命令的用法git

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM