XCode4 with external git - xcode

How do I add an external git repo (such as code.google.com) to Xcode with my project. All I am able to get is to add in the repo, but not use it with any projects. I have been trying the command line options from various websites with no success.

I find XCode has rather rudimentary SCM support. Do yourself a favour and use either the command line or a GUI client, you'll save headaches when things go wrong and the built in client with xcode doesn't always reveal things. Xcode is happy to look at the .git files or .svn files and tell if the status which is useful, but that's as far as I let it go.

Xcode will create and manage the repository for you locally, but you will need to push your commits using the command line.
I've been using it with GitHub, and ran into no issues so far.
Once you push your repo to the web server, all the local commits will sync and upload.

SourceTree is excellent, I use it and the CLI
http://itunes.apple.com/us/app/sourcetree-git-hg/id411678673?mt=12

Related

How to Add Xcode project to Github repository from windows environment

After seeing title of my question you might think like this kind of question is already been asked before. However this is not duplicate, read below to know.
I am developing IOS application. Whenever I get time I work on that every time I use either library's PC or friend's MacBook to developing or making changes in my existing project and then I compress the project and upload it to my Google drive.
I would like to add my Xcode project to Github. I know how to do it from MacBook though. I am looking for way to push my Xcode project from windows environment. As I am poor fellow and can not afford MacBook at the moment.
or
If is there any way I can push my project to same repo on Github from different MacBook every time. As I mentioned before I am using public library to work on my IOS app it is not possible that I can be able to use same Apple PC every time.
Make in windows console -
cd /path/to/my/repo
git remote add origin https://github.com/UserExample/ExampleProject
git push -u origin --all
There is a variety of ways to use GIT within Windows. Github is just a GIT repository cloud service. You can fetch, push, pull command line, after installing GIT on your Windows machine and then CD changing directory to your repository (where the source code is) on your Windows hard drive.
Since you are new to GIT and Github, use the very user friendly Github tool:
Github Desktop
You will be able to use use the existing repository on your Windows hard drive, or if it gets confusing via the Github Desktop to "connect" an existing local repository to the Github repository (https:www.github/myrep). Then just backup your working project to a backup folder and clone the Github repo you are using.

How to use private github repository for ios apps

I'm currently starting to develop an ios app with some friends. We'd like to use a private github repository for version control so we can collaboratively work and push changes to the code. Xcode 5 creates a local git repository, but there seems to be some differences between using git for an iphone app versus the class projects (java projects like connect 4) that I've been used to.
I've created a repository on github, and pushed an initial commit from my local xcode project to the github repository. However, I'm not sure if others will be able to download the code and import it into an xcode project and have it work as intended.
For one, the files on github are organized differently than it displays from my workspace in xcode 5. From the project navigator, most of the yellow folders (folder references, which I don't fully understand) aren't actually folders, and don't appear on the github page. Also, many things (infoPlist.strings, frameworks) are represented in a humongous "project.pbxproj" file, along with confusing build information.
I know that this is a vague question, but I really had no idea what to look up or read. Let me know if there's any way I can improve asking questions on stack overflow. Also, if you know any guides that would help me out with this kind of stuff, I'm all ears.
Introduction
Git and Xcode work wonderfully together to create applications that foster teamwork and minimize versioning complications. However, it's important to understand the basics of Git before proceeding. This answer will walk you through the steps of integrating Git with Xcode, which really isn't too complicated once you understand what's going on.
The difference between Git and GitHub
(The OP might know this distinction, but this is really for anyone else who visits this page and is confused)
The first thing to understand is that Git and GitHub are two completely different things. Git is a version control system, like Subversion (SVN), or PerForce. It can be used independently of GitHub. GitHub is a cloud repository storage system that is integrated with Git. That's why it's called GitHUB; it's a HUB for your code and all it's versions/commits. Git can work with many repository storages, one of them being BitBucket. (This is unlike Subversion, which doesn't have a local repository and a remote repository; you have to push changes from your local repository to your remote repository in Git).
The question asked how to integrated GitHub with Xcode - the evil answer to that is you do not; you integrate Git with Xcode (which Apple has already pretty much done for you). When you commit something in Git locally, you push to GitHub, where your code is stored, and where others (e.g. team members or the public, depending on your privacy settings) can clone or fork your repository and build on it.
Create a remote repository
Let's assume you're starting from scratch. If you're not starting from scratch and already have code in a remote repository, skip this step.
In this step, you want to create your repository on GitHub or BitBucket. Follow the instructions that these sites give you to create the repository.
Getting the URL to Clone the repository
Whether you're using GitHub or BitBucket, you have to be able to tell Xcode where you are storing your code. Find the URI that allows you to clone the repository; GitHub and Bitbucket should have easy steps for finding these. Usually look for the word "clone" on the main screen of your repository, and you'll find it.
Clone locally
Fire up Xcode, with a new project. Hit the "Source Control" menu bar item, and select "Checkout". In the popup where it says "Or enter a repository or location", copy the clone URI that you acquired in your previous step. Then hit next. When asked to clone, Xcode will prompt for a branch; pick which one you want for now. If you have no idea what branching is, then choose "master".
Conclusion
Now you're all set. From now on, most things you need will be under the "Source Control" menu bar items as well; this includes committing, pushing and pulling. Enjoy, and good luck!
Setup the Xcode project as shown here.
Once, done you can see which file’s have been added,modified etc in project navigator.
https://www.dropbox.com/s/r5gsfh2raxwkam6/Screenshot%202014-07-30%2015.03.03.png
For commit,push, or to discard changes, use
Here’s detailed tutorial : http://www.raywenderlich.com/51351/how-to-use-git-source-control-with-xcode-in-ios-7

File doesn't show up in git commit tool

I have just started using git recently. I am having an issue with viewing my changed files in the git commit tool. I am using visual studio as my development environment. I have couple of projects as localhost and localhost/admin. I did some changes to the files in the both the projects. When I run the git commit tool I can see the changes from the localhost project but cannot see the changes from the localhost/admin project. Any idea why it is behaving like that?
Thanks
If there are no changes displayed, means that they were not commited.
Possible reasons for that:
1) These are new files and you need to add them to commit separately
2) Files are ignored by git due to .gitignore rules
I would suggest:
1) Use gitk tool to verify what was commited previously. This tool is included in standard git package.
2) Use external tool to do commits (i am not sure how good VS git plugin, but that could help a lot). In my list of personal preferences is git-cola tool. It can let you choose what exactly will go to commit (even by lines of code)
My other project was redirecting to a different path in IIS.

XCode 4.3 and SVN

I'm new to iOS developing, I haven't used earlier versions of XCode.
Yet I have stored my project on my local hd. Now I want to use some online subversion service.
I cannot seem to find the appropriate options in XCode. The hints that I googled all refer to a menu called SCM which I don't seem to have.
I created a new and empty repository online (webbased) and tried to configure XCode to use it by selecting the "Connect to a repository" menu when xcode starts. After some tweeking in the command line this "connect to a repository" succeeded but afterwards XCode simply closed itself again.
I tried copying the files that belong to my project to the path that I set up to be used with SVN manually. I opened the project in XCode from that path and after adding another file wanted to commit that change but couldn't find how to do that from within XCode.
Now I found that in XCode / Organizer / Repositories / MyProject is listed but has the type "GIT", which is wrong.
Do I have to change the repository type to SVN instead of GIT? If so, how can I?
When you created the project there was an option to put the project under source control. This option creates a git repository and is checked by default.
To use SVN you have to import your project into the SVN repository. (And you probably don't want it to be under git and svn at the same time, so you'll either delete the .git folder or recreate your project without the scm option selected.) Once the project is imported into your repository then you make sure Xcode knows about the repository and you can check the project out.
But really I'd recommend just using Git. It's a modern version control system with lots of nice features (though to do much of anything out of the ordinary requires using the command line) and there are nice project hosting sites for it like GitHub. I don't think SVN compares very well to git.

Howto add an existing VS project to Mercurial (using TortoiseHG or VirtualHG)

I am new to Mercurial / TortoiseHG / VirtualHG. After reading some tutorials I still fail to understand how it is supposed to work.
Could someone please explain in a few simple steps how I add an existing VS2010 project to Mercurial using TortoiseHG or VirtualHG, and how I go from there?
So after adding it to Mercurial, what do I need to do to start working on this project again? Years ago I have worked with Visual SourceSafe, so maybe this experience confuses me right now.
Also I'd like to know what to do when colleagues want to work on this project.
I see in the comments that you managed to get your source files under version control with:
$ hg init
# (setup .hgignore)
$ hg add
$ hg commit
Great! To share the project with your colleguages you need to make the repository accessible to them somehow. You have three options:
Filesystem access: This is the easiest if you already have a shared network drive setup. You put the repository on the shared drive where everybody can read and write. People make a clone from the drive back to their own machine and work on the files there. They commit there as well and finally use hg push to send their changes back to the repository on the shared drive.
Make sure that everybody uses version 2.0 or later with such a setup! There has been bugs in earlier versions of Mercurial that could cause repository corruption when pushing to a repository on a network drive.
HTTP server: You can use hg serve to start a built-in webserver in Mercurial. The server can be used to clone from. In a trusted environment you can start it as
$ hg serve --config "web.push_ssl=no" --config "web.allow_push=*"
to disable the default security settings and allow anybody to push new changes to the server.
For more heavy-duty use, we recommend setting up a "real" webserver and install the hgweb (Fast)CGI script that comes with Mercurial. See the Mercurial wiki for information on that.
SSH server: This is easy if you have an existing Unix setup where people have SSH login to a central server. You need to install Mercurial on the server and create a repository there that people have read and write access to. This is also covered in the wiki.

Resources