Apparently XCode should recognize a git repo automatically, but after doing git init and my initial commit, XCode is not seeing the repo. I have my entire project and git repo in Google Drive, and I suspect that is causing some issue? What do I have to do to get XCode to read .git files in Google Drive?
EDIT
I tried doing a git init, add and commit to a project in my local drive and XCode still didn't recognize the git store, so this may not be a G Drive/Dropbox issue.
Don't put a Git repo on Dropbox or Google Drive. It is terrible. Dropbox, on sync, can scramble all git's internal files and screw it up your whole repository.
Instead, use a Git service. For something private, I recommend BitBucket.
Exemplifying:
Imagine you put your main repository on Dropbox. You sync your dropbox in another computer and pushes to it. The connection drops from that computer. You go to other computer, make another commit and pushes into the main repository. Everything goes fine.
Dropbox starts to sync in this computer. At the same time, the other computer starts to sync, too. But internally, there are lots of different files on the repo. How Dropbox knows how to keep and organize these files?
Simple answer: it doesn't. It will damage your repository, and that's nothing you can do about it. And this is not some kind of "it will almost never happen". It will happen, very soon.
And about the real question:
I never used Xcode, but I had similar issues with Eclipse. It's simple, though: Xcode does not know about the repo because you did not tell him that is a repo. To see how to do that on Xcode, you could see here.
Related
How can you make multiple clones of the same repository on your local computer with GitHub Mac Desktop? After you make the first clone, the repository name disappears from the GitHub Desktop clone choice list.
Related to this, I cloned a GitHub repository onto my local machine, then decided I didn't want it in that location. I simply deleted (trashed) the old repository and tried to clone it again, but could not, because the repository name was not listed. It turned out that because the repository was still in the trash, GitHub Desktop didn't recognize it as gone. I emptied the trash and it saw that it was gone and asked if I wanted to remove the repository. I answered YES and then the repository name appeared in the clone choice list.
You can't clone the same repo twice from the GUI so, instead use command line git clone for that and then you can use the File->Add Local Repository item to select the path and it will show up.
The annoying thing is that having multiple clones of the repo in the Repository List will cause them all to have exactly the same name, because GitHub Mac Desktop doesn't show the paths. Fortunately the order doesn't change and you can always (right click->open in terminal) to see which is which.
If you want to delete a repo that you have cloned - you need to remove it in Github for Mac (right click->Remove) which just removes it from being tracked in the repository list. Now you can delete it from the Finder.
Delete from Finder and then remove from Github for Mac works too.
I have a project in XCode 5.1.1 and the source is in a Git repository. I use SourceTree for managing the Git repository. Lately I noticed that changes to Images.xcassets would automatically get committed with some old commit message.
At first I thought it might be the Git client so I tried closing the Git client and also tried ither clients but it was still happening. I am now sure that its XCode which is causing this. Has someone faced this issue and how to solve it?
I don't think it is your Xcode. Xcode is very simple in handling git. It doesn't do any commits by itself, it doesn't switch your branches (if you don't select the appropiate menu item). It works only on the current branch - when a new file is created, it is added to git, when a file is deleted, it is deleted from git.
Note you can completely turn off Source Control in Xcode Preferences but I guess your problem lies elsewhere.
I saw some people meddling with pre-build/post-build tasks in Xcode to do strange stuff but the most likely cause is a bad state of git branches - bad merging, forcing commits etc. Then the same commit message can appear multiple times but it's just a result of how git tries to synchronize local and remote repositories when forced to.
I need a good looking calender for my iOS application, and I heard Tapku was the best option. However, it looked like I had to pay for a github account to even load the Tapku library.
Also, if it is not necessary for me to pay anything, then how exactly do I download it and put it into my xcode project.
**I have in fact seen the instructions for downloading the library but they made no sense to me.
Github accounts are free unless you want to host private git repositories. But you don't need a github account to clone or download a public github repo. Just click the "zip" link to download a zip or use git to clone the repository like this:
git clone https://github.com/devinross/tapkulibrary.git
(you need to have git installed in order to use git from the command line).
I'm an iOS developer looking to better manage the projects I am creating. I've never touched SCM before so I'm not sure which system to use.
I'd like to keep track of changes to the different apps I'm making for my boss, but also have them in a centralised place, and be able to branch off and be working on features separate from the main app and then merge the changes back in when I'm finished. All of this will be done locally (stored on an external hard disk in my office), and once versions are complete I'd like to be able to export a copy without the SCM features to send to my boss.
I've just upgraded to Xcode 4 and noticed Git is built in. I played around with both Subversion and Git, but it sounds like Git is what would fit my needs better. However, it seems to be totally different to Subversion. The Xcode 4 documentation suggests Git is best for lone developers, but that doesn't seem the case. If the git repository is inside your working copy, how on earth do you make branches of it? Where do you send your changes to? Do you copy the entire working directory and use that as your branch?
Just looking for someone to explain in plain english which SCM system would be best for a lone developer to use and any tutorials people may know of to help me understand it.
Thanks for any help!
Go for git!
The repository actually resides in your working directory. There is .git folder which contains all the data about your branches and commits and whatsoever. You can create a bare repository(only the contents of the .git folder) if you like but having both in the same place is nice, especially if you are a single developer who doesn't need distribution.
Branching in git is very easy:
# create the branch
git branch mybranch
# switch to branch
git checkout mybranch
# show branches
git branch
Git does not depend on a server like svn does. You can have distributed development by using remotes but this is not necessary.
If you like to make a copy for your boss without the git files in it do a
git archive branchname --format=zip -o tree.zip
I suggest some reading on git
Git in five minutes
Git Community Book
The Thing About Git
Branching in git is very different from SVN. Branching happens in place, in stead of in another directory.
Read this book and other resources to get a better understanding about how git works
About the centralized server, Git is a decentralized SCM. That means that every clone contains the entire repository, not only the current working directory.
That doesn't mean you can't have a central repository. On the central server you create a bare repository, and on you're local machine you clone from that repository, push and pull from that repository, often through ssh.
Ok, perhaps I'm trying to accomplish something not doable.
I am a single developer (not part of team).
I'm trying to get some kind of versioning system going. I had used CVS with XCode 3, but XCode 4 no longer has that as an option. I've heard that SVN and Git are better alternatives anyway.
Basically, I've wasted more than half a day trying to get XCode to work with SVN / Git out of the box. I do not have a server running, and would rather not expose my project on a server.
It doesn't make sense for me to have a separate user just to run the Git/SVN Servers, either.
I'm just trying to have version control using either one, in the simplest possible way.
I've tried to add Repo, using local file path (/Volumes/AAA/BBB/Repo) where I manually created the "Repo" directory. I've set the type as Subversion (and also tried Git). XCode says "Host is reachable". But, the Commit functionality is not there (Disabled). I can't import my working directory.
I just don't get it - must I have a server running in order to have SVN/Git, or can XCode just do it through command line? I much more prefer it being done over command line, since the server is complete overkill. Or, am I missing something? Maybe I'm putting in the wrong settings into XCode?
This isn't strictly an XCode 4 issue, I had the same issue with XCode3, but at least it had the CVS option - now it's gone.
With Git you don't need a central server or even a central repository unless you have multiple people on the project. SVN requires you to have a central repo & server running all the time, but with Git you can simply git init a new repo and start using it. If you don't have a central repo you will never use push, pull, or fetch.
Xcode's help mentions the following:
Choose Git or Subversion Xcode supports two SCM systems: Subversion
(often abbreviated svn) and Git. Subversion is always server-based and
the server is normally on a remote machine, though it is possible to
install one locally. Git can be used purely as a local repository, or
you can install a Git server on a remote machine to share files among
team members. The Xcode 4 installer installs the Git and Subversion
tools when you select System Tools. If you are working alone, it’s
generally easiest to use Git, as you don’t need to set up a server. In
fact, Xcode can automatically set up a Git repository for you when you
create a new project (see “Create a Git Repository For Your New
Project”). For a group project, the choice of Subversion or Git is
usually a matter of taste and prior experience. In so far as is
possible, Xcode provides a consistent user interface and workflow for
users of either Subversion or Git.
So the official advise is that in your case, Git is the easiest solution. I'm now in the same position as you described and will be trying Git as advised.
Previously, when working for a small company, we used a dedicated leftover MacMini as an SVN server; this was quite easy to set up, and worked like a charm for many years. Be aware that the SVN integration of Xcode 3 was better than that of Xcode 4 though, so that I ended up using Xcode 4 for development and basic SVN usage, together with Xcode 3 for SVN stuff that Xcode 4 wouldn't do anymore.