Xcode creating tangled git repositories - xcode

I'm attempting to learn git and Objective C - yes, I know Swift is out there. I'm waiting for the excellent BigNerdRanch to publish a book on the topic. And since I have their other book I think it's good for me.
Anyway, I've been creating projects and checking the box for Xcode 5.1.1 to create git repositories on my Mac. For the last 2 projects what I find is that they are tangled up. What I mean is that when I go to the command line I see multiple Initial Commit's that were NOT done for that project.
If this is fixed in Xcode 6 - I can wait. Just curious why this is happening.
These are stored in Dropbox - could that be related? I'm about to reboot and shut down. Maybe somehow git is still open and pulling in everything?
Thanks!

Related

Using Two IDEs ( xCode and VS 2015) for one project

I am struggling to get this right..
I do alot of work on my laptop using xCode.
My desktop is a win10 machine using VS.
I am using git on my mac but only using it on one machine.
I would like to use both machines to edit and commit to my assignments, etc.
My question is how may I accomplish this...I have exhausted google searches and
get more confused than anything, and I am sure this is simple.
When I create an xCode project, I will create multiple targets
as there might be 2 or 3 problems per assignment.
Xcode then creates a project file, etc.
When I go to my windows PC, if I go into VS and clone the repo,
there is not a compatible project file ( obviously, as its not xCode).
What is the simplest way to accomplish this? Keep in
mind I am a beginner with git.
Also, if I use a gitignore file and put it in the repo after the
repo has already had commits, will it drop and delete the
now ignored files moving forward?
Thanks in advance.

Share Xcode project between multiple developers

I have a project and I want to work with another developer on the same project. I'm looking for a way to share the project between us, so that we can work on it parallel at the same time. I need it to work locally, without using an internet connection.
I'm a part of a 2-3 iOS developers team so I can give you a few tips from my experience on collaborating (we use git, I'm assuming you know a bit about. if not, read this), after you get the hang of it here are my thoughts -
Try to make as little change as you can to your project pbx file simultaneity, It'll result in a conflict almost every time
Don't be scared of branches, we're using them all the time, if you two are planning to work on different features of the same product try to do it in different branches
We had serious problems with storyboards and collaboration - like pbx their content change even on open and merging those changes can be very tiring
You already have Git available to you inside of XCode. You can share your code and work on it on the same time using "branching" mechanisms.
Bitbucket has excellent FREE private mode where you and 5 other people can share a Git repository. There are easy-to-use tutorials available on their site. I would highly suggest using that.
I would steer away from using SVN, there are better tools for what you are looking for.
Why don't you use SVN ?
You can configure SVN in Xcode for doing this. Also you can use Git.
Check:
Configuring Xcode to use subversion
Git Source Control With Xcode
Check this question How to set up an SCM in Xcode?.
There you will get links about how to setup SCM for xcode

Xcode 4 and version control - But which one?

I have a question, the answer isn't really hard technically, but I am more looking for the experience of most advanced programmers here.
So like many noobs, I am doing my version control in the crappiest way, which is to copy paste my project directory and rename it with the current date/time.
You will agree that it's a quite limited solution :P
I decided to learn version control system(s), but I am facing many choice, and I would like to know what are the best for your points of view ?
Using Xcode integrated version control (git or anything else), with organizer, cloning, commits from xcode etc. I mean totally or almost controlled by Xcode ?
Ignoring Xcode letting him think there no version control and doing it myself in command line ?
A merge of the two above ? How ?
And then :
Using git ? Github is very popular and powerful, but you must learn git, and learn it hard.
Mercurial ? It seems more friendly.
Something else ?
It would be priceless to have some feedbacks about more experienced people, so that me and many others I hope can choose their paths when facing the VCS wall :-)
Thanks a lot !!!
First: Use a VCS at all.
The rest:
Mercurial is nice, but Apple went with Git for Xcode. So if you want source control integration within the IDE, Git is the best option.
The things I miss most when working with Xcode & Mercurial are the "Modified" indicators in the source list and the integrated diff-viewer. (Which is pretty good in Xcode IMO)
The actions you perform in the Organizer are a bit limited at the moment, but you can always fall back to Terminal.app for that.
I can only recommend git. Merging is easy, I remember the days when a merge conflicts occured with SVN, it was pain, horrible pain to resolve those. You can easily start a local repository with git, especially if you are the only one developer.
Have a look at Which SCM system to use with Xcode 4 for a lone developer?.
I suggest some reading on git for the beginning:
Git in five minutes
Git Community Book
The Thing About Git
Take some time to invest in learning the basics of git, it's absolutely no rocket science to get you started on basic usage and you will benefit from it right away. Once you know the basics of git, you aren't locked into another tool wrapping git, you can use git if there are some problems with XCode. Also, git is available for several OS so the knowledge you gain about git will not go away if you move between different computers that have different OS.
Here are my best of bookmarks for git:
http://www.delicious.com/Ralphtheninja/bestof+git
I've had good success with SubVersion.

How to prevent Xcode 4 from crashing with git branch when the project file changes?

When the project file is different between two branches (say, we added a new source file), switching git branches causes Xcode 4 to crash. What's a good solution to this?
I've noticed the same thing. The only workaround I've found is to close Xcode, do any branch changes I need, then reopen Xcode. Not the best solution, especially if you're switching branches frequently, but it seems to work. Ultimately it's probably something Apple will have to address as Joshua mentioned. Good luck!
If it's crashing, it's a bug and needs to be reported to Apple via http://bugreporter.apple.com so they can fix it.

svn conflict xcode project file while working in team

I'm working in a team that's developing iPhone application (about 7 people). We use SVN for source code control of iPhone code, we keep running into conflict issues with xcode project file and iPhone nib file. I think there has been a question asked about this problem : How to merge conflicts (file project.pbxproj) in Xcode use svn?. I want to ask if anyone has ever come up with a satisfactory solution to this. Since our team is fairly decent in size (7 people), manually resolving conflict in xcode project file everytime someone changes code, or adding new object into nib file is a huge productivity waste. Has Apple engineers ever thought about this issues when they wrote their own iPhone apps ? I have been looking for a satisfactory solution using Google and Bing, not yet found one.
Thanks,
This is definitely a HUGE flaw with xcode. I'm on a team of similar size and here's what I do to make the process as painless as possible:
SVN update (ALWAYS do this before a checkin as well):
quit Xcode. The quickest way to do this is to use Alfred and type "forcequit xcode"
"svn up" in the project folder from command line
If you have any merge conflicts with the project file, hit "edit" to open in emacs or whatever
search for "======" to find merge conflicts; delete that line as well as the "<<<< mine" and ">>>>" lines
save & exit. hit "r" to mark project as resolved.
re-open project - "open MyProject.xcodeproj/"
With a bit of practice you can get this process down to under a minute (I do this several times a day).
for NIB files, DO NOT work on while someone else is working on it. There's no real way to merge them. Make your changes quickly and check in right away (there aren't many cases where 2 people need to work on a NIB file at the same time anyway). For less complicated views, just lay them out programmatically.
Try installing SourceGear DiffMerge. This is a merge tool that should make it a lot easier to merge the changes. Also see this blog post about configure XCode to use DiffMerge

Resources