Git commit checkbox is not ticked - xcode

I'm using Xcode 8.0.
Sometimes, when performing a commit, the checkbox is unchecked for some files. Most of the files are ok, though. I've not seen this before. The file is listed when I run git ls-files from command line before I tick it. It also have a long git log history.
I checked the checkbox and did the commit. I then made a small change, and did the commit again. The file is still unticked. Howcome?
Have you seen this? Is it a bug, or is my repository or XCode messed up?

Related

How to erase Git change on untracked file for now, but show changes in the future

In Xcode, I mistakenly clicked the Convert to use Test Plans button, and Git showed that the .xcscheme file had been changed:
On branch TestBranch
Untracked files:
(use "git add <file>..." to include in what will be committed)
MyProject.xcodeproj/xcshareddata/xcschemes/MyProject-UI-Tests.xcscheme
nothing added to commit but untracked files present (use "git add" to track)
I wanted to roll back the change, but the file is untracked, so there's nothing to roll back to.
I tried resetting the HEAD back to the last good commit, but this change stays (which is understandable, since it's not being tracked by Git).
I had a backup copy of the project from the day before, so I was able to restore the .xcscheme file manually, which restored Xcode's state back to the way it was prior to clicking the Convert to use Test Plans button, so that's good.
However, now that Git is aware that this file has changed, it keeps warning me, even after I restored it to the original state.
The easy fix would be to add the .xcscheme name to the .gitignore file. However, I don't want Git to ignore the file in the future, in case this happens again for some reason (ie, I like that Git told me which file had been changed, so I knew which one to rollback manually to fix it).
The next best easy fix would be to add the .xcscheme file to Git so it is being tracked, but my teammates asked me not to include this file because they don't want it being tracked.
So, the question is this: Is it possible to make Git forget the change to .xcscheme up to this point, but still alert me if it changes in the future?
However, now that Git is aware that this file has changed, it keeps warning me, even after I restored it to the original state.
Git should not "warn you" (about an untracked file) any more after restore than before.
Showing MyProject-UI-Tests.xcscheme in the untracked section of git status does not mean it has changed, only that is is untracked.
Git cannot forget changes of what it does not track.
Only an external process comparing that file to a pristine copy (a backup you know has the right content) could alert you of any change.
The OP James Toomey confirms in the comments:
I was wrong that this file had been there all along.
There are multiple .xcscheme files, but the UI-Tests one only appeared once I clicked that button.
So, the reason the file appeared in Git's "untracked files" section is because this is a new file that had never been there before, so Git is basically saying, "what to do with this new file, do you want to
a) start tracking it (with git add), or
b) ignore it (by adding it to ".gitignore")?

How to recover committed changes git Xcode?

I committed changes to a local git repository today in Xcode so that I could go back to an older version. The newly committed changes from today are not showing up in the source control tab within Xcode; however, when I navigate to the .git folder in Finder, I can see the commit message in the COMMIT_EDITMSG file. This leads me to believe the commit did work, but for some reason Xcode isn't recognizing it. Is there any way to manually recover those committed changes from Finder if Xcode won't recognize them?

Xcode 4.4.1: how to disable auto commit for several changed projects?

Does anybody is facing a weird svn auto commit behavior in xcode 4.4.1? Have noticed, if working with several projects at the same time and you are doing svn commit then Xcode grabs all changes from several projects and tries to commit them all. It very annoys me as it's very easy to commit unfinished changes accidentally, because Xcode svn commit opens a tab where only changes of active project are shown. Is there a preference setting for disabling this?

Xcode 4.4.1: git no longer showing modifications

Suddenly, unfortunately, I can't place the moment of occurrence Xcode has stopped showing git information, nor can I submit/revert/etc via git from inside Xcode. If I check the Organizer's Repositories, my project is still listed with its last commit.
Using the command line: git status, I see all the unstaged changes as I would expect.
So, the project is still under git control, but somehow detached from Xcode.
I was able to fix this issue by going to Organizer in Xcode, selecting my project, and deleting the Derived Data. You may need to quit Xcode and re-open your project after doing this to let Xcode rebuild the project index.
Installing the command line tools worked for me

Xcode git is not committing project.pbxproj

I have a remote git repository and I am trying to commit and push my latest changes. The problem is that everything commits fine except for project.pbxproj. Xcode does not complain. It just acts as if all committed with no issues. But when I push it complains that there are uncommitted changes. So I try to commit again. It shows that there are changes in the project.pbxproj. Fine. This has happened before. I have just committed again and all is good. But not this time. I commit. Xcode has no complaints until I try to push. So I try to commit again and I see that it really did not commit because the differences are the same as before.
Opening the log navigator can help you find what's causing the problem. Choose View > Navigators > Show Log Navigator to open the log navigator. Select the commit from the log navigator. The editor will look similar to the following screenshot:
On the right side of the blue area of the screenshot is a small button. Click that button to open the transcript, which can help you determine why the commit is not working.

Resources