I am using xcode and its source controler.
I would like to compare two branches I made.
Impossible to do so by using the comparison mode. When I do it, it splits the editor in two (that is right) but I cannot put on branches on one side and the other one on the other side.
Any help?
All the best
Yes you can compare file wise, just go to that specific file where you want to see modified changes by other branch.
Then you will see following bar in editor
on left side, select your own branch and on right side, select branch which has done modifications.
Then you can compare by commits, listed time wise just beside branch name.
In Xcode 12 you choose View->Show Code Review. You'll have two windows, one with the most current edits ("Local Revision") and the other lets you choose from various prior commits.
Assuming you already pulled both branches and now you're watching a feature branch, run
git reset develop
where develop is the other branch to compare.
After that all the modified files and folders are marked in the file inspector.
Next, you can simply use Xcode file comparision:
I don't think this is available yet (Xcode 11). The best you can do is compare individual commits or if you know which files were changed, you can compare individual file changes for those commits.
In XCode 11.x you have to press the two arrows, located on the top right.
Related
Weird issue here. I merged two branches with different feature sets. I branched from one of the two then merged in the second (using command line). Now in Xcode's source control pane it shows two different branches as current. It's not a big deal but I would like to know how to get rid of the top one (at the very least) and preferably to understand why both would be displayed as current. It makes pushing to remotes a bit of a headache because they have the same app name and so I need to make sure I don't push to the wrong branch. I don't particularly want to have to redo things a different way since the branches had a fair number of merge conflicts.
Figured it out... There were two files that were pointing to the other branch folders in the pbxproj file. This appears to have happened when I merged. Removing the references to these files and pointing to the files in the correct project folder then committing and pushing made the extra branches go away.
I'm programming in xcode (actually Phone Gap in conjunction with xcode) with git. I'm having a strange issue. When I create two identical branches and try to check out back and fourth between them with out making any changes git is telling me that I need to commit because a change has been made (this same thing is also resulting in merge conflicts). It says the changed file is:
platforms/ios/Butterfli.xcodeproj/project.xcworkspace/xcuserdata/benpearce.xcuserdatad/UserInterfaceState.xcuserstate
Can anyone explain what's going on and how to deal with it.
Yes, .xcworkspaces are simply files that Xcode uses to describe the workspace or projects.
IMHO, There's no need to check these files in at all, unless you share settings with other folks in your projects (and in your case, I suppose other machines that have a user named "benpearce").
In fact, you can safely add them to your .gitignore file.
More info can be seen here
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
How is it possible to view two different files on two different git branches in Xcode? I have renamed one of my class and also added new logic to it. And now I would like to see together the two file in the left and right panel. Meantime I created and checked out a new branch and committed changes.
No, this isn't possible, but there are ways of getting the file's contents using the git command line. See the following SO questions:
View a file in a different Git branch without changing branches.
How to get just one file from another branch.
I am working on a project with another developer. We are in the process of a major upgrade with lots of breaking changes. The software we are working on is an AddOn to a product, and we are upgrading to work with a new version of the product. He has checked in some breaking changes that will not run in my environment yet because I am still running on the old version of the product. I have checked in some changes on top of those. Is there any way I can retrieve the code such that it includes only the changes up to the point before the breaking changes and also include only my changes after that in my workspace?
If I had not done a "get latest" I would be OK now because I made the changes on my machine so I would have them. But now I need to "get specific version" to take me back before all the breaking changes and somehow merge only my changesets into my workspace. But there seems to be no way to merge changesets into a workspace, only into another tree. I could select only the files that I touched and get the latest versions of those files, but some of the files contain changes from both my changesets and his changesets (and mine are after his).
So what I really want is a way to merge specific changesets into my workspace (without pciking up all the previous changes) to get back to the state I was in before I did "Get Latest". Is there any way to do that?
Looks like there's no good way to do this. Fortunately, I had another branch that represented the changes I wanted (I had only merged my changes I wanted into it). It didn't feel right to just copy the whole tree over my working tree, so I used WinMerge to identify the files that were different and copied just those files over (after a cursory look to confirm that it was a file that included my changes -- there were a few files generated by Visual Studio that were different just because they were in a different path).
So I guess the general solution would be to create a branch in TFS, merge everything you want into it, get a local copy, then copy the results into your workspace. That does leave a mess in TFS, though (how do you completely remove the dummy branch?) Fortunately the branch I had was one we really wanted to keep (we have a build branch separate from teh development branch).
I'm not really sure if this answers your question, but if you select "Get Specific Version..." then you can select a specific changeset.