1

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:

enter image description here

But when I make any changes in the actual project, no source control badges show up i.e. 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...):

enter image description here

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")
Neil
  • 2,004
  • 3
  • 23
  • 48
  • 2
    Forget Xcode for a minute; what happens at the command line? What does `git status` tell you? – matt Mar 18 '13 at 02:43
  • 1
    That's great! So it's working fine at the command line. Clearly you *are* able to git-add things to the local repo and commit them; otherwise, it wouldn't know that it's tracking `CrunchCalculator-1-2/ViewController.h`. And it knows about the remote. So it's working! The only thing that isn't working, then, is the Xcode interface to git. Personally I don't regard that as terribly important; I use the command line or SourceTree to manage my git projects anyway. – matt Mar 18 '13 at 03:09
  • that's true! Looks good, but it would be great if I could get Xcode to work with it. Really... It should be working. – Neil Mar 18 '13 at 03:13
  • Two questions: 1) From the 'Organizer Repositories' view when you click on 'Remotes' do all the remotes show up and if you select one of the remotes is its 'Location' shown correctly? From the main Xcode window if you select your Project name does the Utilities window indicate that the project is under source control? – GoZoner Mar 18 '13 at 03:13
  • Also, there is this: http://stackoverflow.com/q/14744064/1286639 – GoZoner Mar 18 '13 at 03:17
  • @GoZoner the utilities window http://i.imgur.com/OnbtjZJ.png – Neil Mar 18 '13 at 03:20
  • There is no 'Source Control' section (you might need to click on and off a file to get it to show up, for some unknown reason). Like http://i.imgur.com/ft29qQl.png – GoZoner Mar 18 '13 at 03:27
  • @GoZoner Ahh, but you see, I don't have anything like that. Under your's it says "Modified" with that `M` badge. But I don't ever get those badges. – Neil Mar 18 '13 at 03:34
  • http://en.wikipedia.org/wiki/Stinking_badges :) – matt Mar 18 '13 at 03:38
  • You should consider learning the command line utilities; knowledge of how they work will make troubleshooting this kind of problem easier. – Eric Walker Mar 18 '13 at 04:17
  • Under File:Source Control have you tried 'Refresh Status'? And are you 'showing working copy status'? – GoZoner Mar 18 '13 at 04:35

2 Answers2

1

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!

Neil
  • 2,004
  • 3
  • 23
  • 48
0

Instead of using the XCode for GIT use Command line.

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

MaheshShanbhag
  • 1,484
  • 15
  • 14