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?
I made some changes to a few files within VS 2019.
I added a comment and clicked Commit All under Git Changes tab (didnt do a Push).
I realised i made a mistake by including some temp files so i clicked Revert under Git Repository Explorer against the comment i made.
All my changes have been lost in VS 2019..... Is there anyway to recover my changes?
Managed to resolve this after panicking a bit!! Just in case this helps anyone
Clicked Git in the VS 2019 menu.
View Branch History.
Under Local History, i right clicked the row where i made the changes and added my comment.
Selected Revert > accepted the warning
All my work was restored. I then continued to do the usual Commit and Push which then pushed my changes to the repo and i was able to verify that.
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?
So I went to sync my changes with Github and I ran into a few problems with main.storybaord. So I re opened Xcode, opened my project, and I saw a C next to my storyboard.
Now when I try to open it, nothing shows up except for an error message saying:
Interface Builder was unable to determine the type of
"Main.storyboard".
Please Help! Thanks!
The C means Merge Conflict.
You basically have two options:
revert to the last working revision
resolve the merge conflict by picking the correct change
The first one will revert all the changes that where made since the last commit. Right click the file, choose "Source Control" / "Discard Changes in ..."
The second one is best done from the terminal. Open the terminal, go to your project root and run
git mergetool
FileMerge will open, pick the correct changes in there.
Then do a
git commit
to commit the merge.
I have created a new project and checked the "create a local git repository" option. I opened the organizer to check that there is a repository for my project and it was there. I made some changes on some files, and noticed the source control specific letters "A" .. "M" beside them, but when I choose: File-> Source Control -> Commit, I get the following message from XCode 4.2:
the operation could not be performed because no valid working copies were found
Please verify that your files are under source control and try again
However, I opened the organizer again, and noticed that the repository of my project includes three icons on the left bar: Branches, Remotes and a folder with the same name as of the project. I chose the last one (the folder) and pressed the Commit button on the bottom bar of the organizer. The commit sheet opened and I performed the commit successfully. Now, when I close the organizer, and edit some files in my project, I do not see the source control specific letters "M" ... "A" ... beside each modified file.
My problem is about two points:
1) Why can't I commit from File->Source Control->Commit menu option
2) When I commit from the repository itself, and go back to the project and edit some files, why do not I see source control letters beside modified files?]
For what it's worth (and as #Jahelia's comment mentions), this seems to be a bug in XCode 4.2 when it first engages with git. The workaround seems to be to at least close Xcode and reopen. (If that doesn't work, try opening and closing the organizer.)
I encountered this myself today when trying out Git with Xcode for the first time. I created two demo projects with the "create a local git repository" option and they had the same problem. I was able to commit from the organizer window, but the main Xcode file view didn't seem to recognize git at all.
After quitting and restarting, I created a third demo with the git option, and the main window recognized the changes (after building) right off the bat - i.e showed the "M" beside a modified file.
I've experienced and recovered from this.
I can't tell you what causes it but, notably, in the "Repositories" view in my Organiser, I had TWO similarly-named repositories. What differed about them was the case of one of the paths.
One was "~/Work/Code/Bumhole" and the other "~/work/Code/Bumhole".
I caused the problem by XCode crashing during a commit to the repository (of many changes).
I fixed the problem by
closing the offending project
closing Xcode
rebooting
reopening Xcode
(close the project if its open)
open the Organiser view
Select the "bad" repository and delete it with backspace
Navigate the remaining "good" repository until you see the .xcodeproj file
Double click the .xcodeproj file to open the project
I expect this list is a superset of the steps needed to fix the problem, but this worked for me.
If your project is in /Developer/.... move it elsewhere and reopen the project. This may resolve your problem.
There seems to be a problem under Xcode 4.2 with projects in /Developer/... and git integration (you get the error "The operation could not be performed because no valid working copies were found. Please verify that your files are under source control and try again")
This bug still exists in Xcode 4.6.3 and when using Subversion.
I know this has already been answered but this worked for me:
Open terminal
cd yourprojectdirectory
git config --global user.email "youremail#email.com"
git config --global user.name "username"