'Commit to Branch' option in XCode 6 - xcode

In earlier versions of XCode, there was an option called Commit to Branch on commit page which really helped when you'd messed around too much with your code in a particular branch and didn't want to commit it into the same branch and neither did you want to lose all the code that you'd written.
I couldn't find this option in XCode 6. Is it still there hidden somewhere, or have they removed it?

An excerpt from the "Save and Revert Changes" section of the Apple IOS Devloper's library
https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/ManageChanges.html
Create a Branch to Isolate Risky Changes
After you’ve worked on a project for a while, you are likely to have a
body of reliable, stable code. You can choose Source Control > Working
Copy > New Branch to create a copy of that code. Then you can work on
new features and other changes without destabilizing your existing
code base. When you are satisfied with your changes, you can merge
them back into the body of stable code. Use Source Control > Working
Copy > Merge from Branch and Source Control > Working Copy > Merge
into Branch to combine and reconcile differences between versions of
your project.

Related

How to solve: Xcode shows files still as modified after commit

I am using SourceTree as a git client.
A while ago, I had a major problem with my project and my git, so I had to reactivate a copy of my workspace from an external source. For that purpose I had created a complete new repository. Commiting to that now.
Today I've noticed, that most of my files appear as "modified" in Xcode. Even after commit and push (with SourceTree).
Source Control shows my two branches, what is correct:
And the History shows perfectly all the commits:
My feeling tells me, that in the background the old repository information is still present and does this bug. How do I handle this? Help is very appreciated.
Edit:
git diff --ws-error-highlight=new,old Output
Close Xcode. If you can avoid it, don't reopen Xcode :-) If it's an absolute must, reopen Xcode. The M markers should be gone.
This worked for me:
Delete derived data folder(Steps: Click Xcode on top left -> Preferences -> Locations -> Click on the right arrow below Derived Data and that will you take you to the Derived Data folder in Finder. Delete it)
Quit Xcode (Don't just close the project)
Reopen Xcode
Check if the nature of the diff is related to eol (end of lines).
See "git diff - show me line ending changes?", like:
git diff --ws-error-highlight=new,old
If that is the case, try first:
git config --global core.autocrlf false
Then try again to clone your repo, and see if XCode still display those differences.
In your case, this is not about eol, but about an update done in your files.
Check for any .gitattributes file: is there a smudge directive in those files (which would explain an automatic process taking place on checkout)
See Keyword expansion for an example of smudge script.
Something seems to update JTAppleCalendar to its latest relase (6.0.1 from 7 days ago)
My feeling tells me, that in the background the old repository information is still present and does this bug.
Simply try, in command-line, to clone again that repo (in a brand new local path) and check if the issue persists in that new cloned repo.
to the JTAppleCalendar, I have changed from 6.0.0 to 6.0.1 manually. around 7 days ago. when the new xcode 8.0.1 arrived
In that case, all those files should be listed as modified: that is what Git does.

Lost changes when changed the branch without commit

I am using this tool Git GUI Tool. I have added few files as well as done changes in few files. Now by mistake I have changed the branch without commit. Now I can see the new files but with partial code not, lost some functions. Same with the modified files I lost almost all changes. So, any way to recover this changes.
It's XCode project.
I am badly stuck. Kindly point me in right direction.
Git doesn't touch the untracked files when you switch branches. It also won't let you checkout if you didn't commit changes to the files you track. But this is git - who knows what this tool you are using does before checkout. It could have stashed your changes so check your stash if you haven't done this already.

Using xcode5 svn or git

I am learning git and SVN in Xcode 5.
My question:
How should I revert back my previous commit when I commit my code?
Is there a way on a branch to revert back to previous commits?
For example, I commit a state, call it GOODSPOT, then I commit, a few times as my code progresses. Can I easily revert back to GOODSPOT, in a single click ? Or do i have to go through line by line. Similar to going back to an old snap shot ?
https://developer.apple.com/library/ios/documentation/cocoa/conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html
Here is what you can do
$ git push origin (branch)
You can go back to any commit you want to. Use the command-line interface (also known as Terminal).
As far as I'm concerned every time i try Source Control. It depends on whether you are working with people. I would just go back to the terminal and recommend it.
For versioning in Xcode, I do this:
- in my Developer directory I set up a project folder
- then Duplicate the Outer initial folder Xcode sets up and append its name with a number and two word description of where it's at
- this also duplicates development art, research notes etc
- the inner folder is all XCode cares about, so that one gets untouched
- when the finished app ships, I illustrate its development for proving copyright originality

Subversion tree conflicts when attempting to merge near identical branch

I have an iOS project under Subversion source control and I am using Cornerstone as my SVN client. (I have also tried using XCode for this as well)
I've had numerous problems merging branches, and hope someone can help!
In the simplest test I have done, I have:
Created a new branch from the trunk
Made one small text change in one file in the new branch
Immediately attempted to merge the change back into the trunk from the branch.
When Cornerstone analyses the merge contents, it reports lots of tree conflicts and newly added files.
Other (potentially) relevant info:
I am the only person working on the project at present, so there are no other changes being made.
I have tried merging from branch-branch, trunk-branch, branch-trunk all with the same result
The server is using SVN v1.4.2, my client is v1.6.17. I am suspecting that this may be the cause, but am looking to get this confirmed if possible.
Thanks!
It appears that the problem is due to the server being v1.4.2.
I deleted my existing working copy and checked out a fresh copy, ensuring that the SVN version was set in the check-out dialog box to 1.4.
Now, when I attempt a merge, I only get the options to "Cherry Pick Changes" or "Advanced Merge". The "Synchronise a branch" or "Reintegrate a branch" options no longer appear, so these must be options not supported on 1.4.2 and be the cause of the conflict explosion I was seeing.
In summary, to merge between my branches it appears that I have to select the specific revisions that I wish to merge.

xcode 4 not cooperating with git

I'm seeing some strange behavior with Xcode 4 and git.
Create a new project
Right click on files - choose source control then commit. Add a comment.
Choose source control then push from the file menu.
Xcode returns an error complaining about uncommitted changes?!?
Calling git status from the command line, I can see that some of the internal userdata files are not committed. Shouldn't Xcode know to either skip or include those? There is no indication in Xcode that there are any uncommitted files. The only way to find them is from the command line.
One thought would be to manually create a .gitignore file, but I would assume that Xcode handles all that internally.
Did I just stumble onto a bug, or is there some standard step that I'm missing?
Thanks!
Well, a bug is in the eyes of the beholder, isn't it. Yes, you need to Setup your git ignores for xcode.

Resources