Xcode error "file not found" after git rebase - ios

Just re-based the repository Xcode project to an older version that used to work fine. (in an attempt to add back support for iOS 7)
Now - one of the frameworks is through a "file not found" error for the header files. But, the files are still there. Everything used to build just fine on this version of the project (3-4 months ago), everything builds fine on current, new version of the repo. So, why the trouble here?

Rebasing is a concept where in you change the entire history of your commits. You should only rebase a branch onto its parent branch or it might create issues.
Rebasing repositions the head and then applies all commits made after the point of branching as patches, one patch at a time. Each patch is applied and resolved for conflicts if any. You must do this until all patches are applied. If you are not careful in this process, its easy to accidentally lose code or entire files or frameworks that you have added.
Please go through the git rebase documentation for more details.
Hope this helps :)

I have found that git rebase can be a bit of a nightmare when using XCode. From my experience, the best solution to making sure a branch is up-to-date with master is by doing the following (instead of rebasing):
While on your branch you created off master:
Select Source Control on the XCode Navigation Bar -> Pull -> Pull remote changes, select "origin/master" and select "Pull"
I've had the most success doing things this way vs. the pain of fixing a rebase gone wild.

Try these steps hope this will help you.
1)target of project -> Build Phases -> Compile Sources ->
2)delete the [found filename that cause the error in program].m
3)Add it back again in you project.
4)Clean Your iOS project And then Build Again.

Related

git branch crossover error

Looking for a general suggestion as I occasionally run into errors in branches in my iOS git efforts. I create branches from dev to isolate changes as per usual. I start out with everything tracked, including pods. I commit often from Xcode to remote, and only use SourceTree to manage higher level stuff like branches, merges etc.
BUT.. every so often, when i return to a branch and compile before restarting efforts, i see "no such file or directory" errors for a file or three from other branches. I just don't see what i am doing wrong, unless staging every file is my mistake.
Is this enough for somebody to offer advice? If not, and if the question is too general, feel free to wipe it, thank you.

Cocoapods project.pbxproj merge conflicts

I have spent a long time looking for an answer regarding merge conflicts with project.pbxproj files. My merge conflicts mainly occur with Cocoapods. It seems that if I add a pod on a branch, then try to merge it into another, many many merge conflict arise in the project.pbxproj file of my Pods project. I would simply go trough and fix these conflicts manually, but there are way to many for this to be reasonable. Has anyone else encountered this problem and found a reasonable solution. This issue has plagued me for sometime now and I am only asking this question as a last resort. After creating a couple of new features on separate branches, having this much trouble including them into my project is very frustrating. Any help would be very much appreciated.
As long as you're not making changes, which you probably shouldn't be, to the Pods.xcodeproj file, then the source of truth is always what is generated with pod install. Therefore if there are many conflicts you can just delete the project and regenerate it.
I've run into this on a fairly regular basis. I have a recipe that works most of the time. We use Git-flow, so are typically trying to merge feature branches into develop. Memory being what it is, often the first time we notice this is when GitHub warns of a conflict.
Commit (or stash) all outstanding work on your local feature branch.
Run pod deintegrate (docs here)
Commit the branch. It’s temporarily in an unusable state. This will be resolved momentarily.
Switch to the latest develop
Again, run pod deintegrate
Commit changes to develop. Don’t push these changes up to origin. This commit will be deleted shortly.
Switch back to your working branch.
Merge in your local develop. Hopefully this will be conflict free.
Run pod install, run the apps and check that everything works as expected.
Commit the merge. Delete the local develop commit (i.e. git reset to origin)
Push working branch changes.
You may also want to consider using a hook to prevent pushes of integrated projects. This puts the onus on the developer to pod deintegrate before pushing changes up (and also requires other developers to pod deintegrate before merging from develop) but does remove one potential source of conflicts if using a cloud repo provider that manages your workflow like GitHub.
It's also worth splitting out file-add operations into their own commit to reduce the noise.
Following by this guild: https://github.com/CocoaPods/CocoaPods/issues/3093
For CocoaPods to say that message, the project will have <<<<<<<, >>>>>>> or ======= on a line indicating it has a conflict which hasn't been resolved.
It is possible that there is still the conflict markers and the file is still in a conflict (git only says it's resolved because it was told it has been resolved regardless of the conflict markers).
You can find them in your file by running the following:
grep -E '<<<<<<<|>>>>>>>|=======' /path/to/project/project.pbxproj

Version control for graphics alongside iOS project

I'm working on my first iOS app and have decided to stop being irresponsible and do a good job with version control. My project has been migrated over to a new repository that I established with the DP of Xcode 5. There are a number of images that I've created with Paint Code and Pixelmator that most certainly deserve the same attention to version control as the source code for the app. I love having git hidden behind the UI of xcode - Is there a clean way to include other random files (like Pixelmator files for example) in the same repository as my iOS project and have it all maintained together? Presumably this would not happen in xcode. Don't want any files left out of the party.
I would recommend to use SourceTree or the command line for this. Every other git tool should work fine too.
You don't have to (and honestly, you should not) add your assets (.psd, .ai, .pxm, etc) to Xcode. Just commit them without Xcode.
I do exactly this since a couple of years. All my "raw" files go into an "assets" folder in the root folder of my project. Those files are not added to Xcode, I manage them with SourceTree.
Actually I manage the whole project with SourceTree. I don't use Xcodes Source Control features at all. The git support in Xcode is really basic if you compare it to SourceTree.
Once you've used "Stage Selected Lines" and "Stage Hunk" in SourceTree you can't go back to Xcode.
I put my graphic work files in a folder alongside Resources, but i exclude it and all its content from the target(s). Works for me (using Git).
Can't talk about Xcode 5 here since it's NDA - check out the developer forums for more info (once they get unborked from the hack attempt).
In every recent project I've worked on, we have just included the files in the git repository. Git handles binary files like images just fine, so Xcode should pickup the fact that they're modified and you'll be able to commit them. I personally use the command line 90% of the time, and the other 10% of the time I use SourceTree (for merging / conflict resolution).

pull changes from branch when deleting files

I can't figure out the best way to do this and it has happened a few times where I mess myself up that it'd be nice to know a possible good way for this. On master, I have our main project. We finally got approved to use ARC in iOS and I created a new branch for that to not mess with the main working master branch. I also took the time to delete some unneeded files in my ARCBranch. What I want to do is use this branch for development for the next release. I'd like to pull in the changes from master to the ARCBranch. So I switched to ARCBranch, and did
git pull origin master
I got conflicts, some which were straightforward because I could see the code, others being changes in the pbxproj file where I cannot tell what's what. I did see
<<< HEAD ==== >>>. I can't tell what I need to do here. I can't open it in Xcode, only a text editor. I tried just deleting those <<< === >>> characters since I saw one person on SO say that you typically want both changes and that you could always do that. This didn't work for me. I was wondering if there is a better way to do this change. Maybe somewhere where I can see each change by change happen? Thanks.
Instead, you could try
git rebase master
This would apply the changes commit by commit. If there are conflicts, it would stop there, so that you can resolve them and do
git rebase --continue
to finish applying all the patches.
It failed to auto merge so it marks the conflicting blocks of code and leaves them both so you can decide and remove one yourself.

TFS2010, is it possible to create a branch retroactively?

Been using TFS2010 for just a few months now so relative newbie, and now possibly need to create my first branch, unfortunately I need to create it from an older changeset, is this possible?
Basic scenario is I converted a project from VSS 6.0, with history, and it all came over fine. Project has approx 500 source files.
Before the conversion from VSS we started working on version 4.0 of our project, with no plans to release any more bug fixes to 3.1 so we didn't establish any branches at that time.
So we have made significant changes to about 20 files (which I can identify), but now the client wants to release a 3.11, 3.2, 3.3 etc because not everyone will be ready to go to 4.0 product anytime soon.
I think we want to create a branch, and then use TFS to rollback about 20 files in that branch to an older version, is this possible to do? Create a branch from where we are now, and then rollback some of the files? or does creating a branch cause you to lose history for that branch?
Slightly complicating things is that after we started working on 4.0, besides making the 4.0 specific changes we also have several changes that we made that would need to go into both he 3.1 branch AND stay in the 4.0 branch we are working on now, and furthermore, and more bug fixes we need to put in over the next several months would need to apply to both branches.
Perhaps this is a pretty straight-forward use case for TFS, but just wanted to make sure I don't mess up what is already working perfectly fine.
Suggestions?
You can create a branch from any changeset, and it's very easy from within the Source Control Explorer UI. Just navigate with Source Control Explorer to the server path you want to branch, select branch, and then you'll be given the option to "Branch From Version". Just select whatever changeset you want to branch from and your new branch will be created from that instead of the default of the latest version.
Why don't you choose to get the appropriate base version with "Get Specific Version" which will summon the sources in the state you need - of your version 3.1.
Then construct a branch to continue work towards 3.1x
Executing 'Get Latest' on your base branch should result with your sources in version 4.0
I have just done this.
I started my solution with a single branch team project in codeplex :
-MyPrettyCMS/Database
-MyPrettyCMS/Framework
-MyPrettyCMS/Layers
-MyPrettyCMS/Portals
-MyPrettyCMS/Solution
It's not possible to create a branch of the team project
WARNING ! I tryed to convert Team Project folder to a Branch, it worked but after that, I can't create any branch and I had not enough rights to undo that (I had to ask the Code Plex TFS Administrator to undo for me).
All of this must be done with team explorer and not with solution explorer.
So I created a Team project folder subfolder CurrentRelease like this
-MyPrettyCMS/Database
-MyPrettyCMS/Framework
-MyPrettyCMS/Layers
-MyPrettyCMS/Portals
-MyPrettyCMS/Solution
-MyPrettyCMS/CurrentRelease
Then, for each folder I used the team explorer move command (DON'T MOVE FOLDERS with the Windows explorer even if you have the plug in, because sometimes it fails).
The result is
-MyPrettyCMS/CurrentRelease/Database
-MyPrettyCMS/CurrentRelease/Framework
-MyPrettyCMS/CurrentRelease/Layers
-MyPrettyCMS/CurrentRelease/Portals
-MyPrettyCMS/CurrentRelease/Solution
At this point you must archive each CurrentRelease subfolder
Now you open windows explorer and you verify each folder and its descendent to see if you forgot some files. If you did, copy it to the new folder, add it to archive with the Add files of Team Explorer. You must archive again.
Right click on MyPrettyCMS/CurrentRelease ans select command create a branch
I used CurrentRelease-To-2-50-001 as Branch name
Then I have
-MyPrettyCMS/CurrentRelease/Database
-MyPrettyCMS/CurrentRelease/Framework
-MyPrettyCMS/CurrentRelease/Layers
-MyPrettyCMS/CurrentRelease/Portals
-MyPrettyCMS/CurrentRelease/Solution
and
-MyPrettyCMS/CurrentRelease-To-2-50-001/Database
-MyPrettyCMS/CurrentRelease-To-2-50-001/Framework
-MyPrettyCMS/CurrentRelease-To-2-50-001/Layers
-MyPrettyCMS/CurrentRelease-To-2-50-001/Portals
-MyPrettyCMS/CurrentRelease-To-2-50-001/Solution
I archived the Initial version of the branch.
Now I can work on my next release and make some minor corrections to the current release.

Resources