2

I had/have Source Control working with Xcode 7.0 beta 5, but when I try to do a Commit in my newly installed Xcode 7.0 GM it won't work. (The new Xcode 7.0 GM had replaced my previous Xcode 6.4 version, which never had Source Control working.) I get the error message The working copy "APP NAME" failed to commit files as is seen in the following image:

enter image description here

This question is similar to

but for mine it does work in the beta Xcode version, just not in the standard version.

I tried running the suggested command line commands as per this answer, but there was no noticeable difference. It seems like there must be some file I could edit or replace, but I don't know where it is. Both of my Xcode versions use the same project folder.

Update

Typing git config --list inside the project directory I get the following (email changed, but correct):

user.email=my_correct_email@mymail.com
user.name=Suragch
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.MongolAppDevelopment-iOS.url=https://github.com/suragch/MongolAppDevelopment-iOS.git
remote.MongolAppDevelopment-iOS.fetch=+refs/heads/*:refs/remotes/MongolAppDevelopment-iOS/*
branch.master.remote=MongolAppDevelopment-iOS
branch.master.merge=refs/heads/master

Again, I can make edits to the project in the standard Xcode but in order to update git I have to go back to the Xcode beta.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
  • When you "`cd`" to the project directory and type in "`git config --list`", what do you see? Also, do you even have a "`.git`" directory at the root of your source code folder? Type in "`ls -a`" in your source code directory to find out. – Michael Dautermann Sep 26 '15 at 08:08
  • @MichaelDautermann, There is a `.git` file. See update for config list. – Suragch Sep 26 '15 at 09:38

1 Answers1

3

git config --list gives you local and global (and system) git configs.

Check if user.name is still registered in the local repo: git config --local -l

If not, it is likely that the XCode7 beta consider a different $HOME, while your command line uses the regular HOME (in which you have a .gitconfig iwth your user.name and user.email)

Simply try and set those in your repo:

cd /path/to/rpeo
git config user.name Suragch
git config user.email my_correct_email@mymail.com
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • You were correct. Typing `git config --local -l` showed that `user.name` and `user.email` were missing from the list. After adding them in the way you said, Source Control worked in Xcode. – Suragch Sep 26 '15 at 10:24
  • Thanks VonC, that was killing me. – Perjan Duro Oct 09 '15 at 14:41
  • and, to find the path to the repository for your current directory, you can use `git rev-parse --git-dir` – salo.dm Nov 21 '15 at 02:09