简体   繁体   中英

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. 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.

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:

在此处输入图片说明

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. 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

# 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.

Changing the name of the project!

Instead of using the XCode for GIT use Command line.

This link give you a the usage of various GIT commands git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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