I have an Xcode project with a few commits, and now I would like to load it onto Bitbucket, without losing my commit history. What would be the best way to do this?
Create a new repository, and push to it from Xcode like normal. It will preserve all of the commit history.
You could follow the Import Code into (BitBucket) repo, and select a Git repo on your local workstation.
The fact that this local repo is managed by XCode4 doesn't matter.
After the import, you can add your Bitbucket repo as a remote, with an https address, as mentioned in "Bitbucket + XCode 4.2 + Git" (even though the XCode GUI might not be enough, and some command lines might be needed).
Related
I'm trying to set up a GitHub Repo for an existing Project (in Xcode). I'm already logged in with my GitHub Account. But as soon as I try to Push a commit to the Remote Repo, this Window Pops Up
I can't select anything. How can I fix that?
You can't push a local repo that is not associated with a remote repo (known, for short, as a "remote"). Give this repo a remote. You can either make one at GitHub now, or associate this repo with a repo at GitHub that you have created already. Here's how to do that using Xcode's interface:
Personally, though, I never use Xcode's Git interface for much of anything; it's atrocious. Learn to use the command line; you'll be much happier (in my opinion).
I'm working with a teammate on Xcode, and we plan to use GitHub to collaborate on the same Xcode project, so it would be like I make changes on my side, commit to the repo ,and then he can pull from the repository, make changes and commit again.But it seems that it is only possible to commit to a repository from the Xcode project which the Git Repository was created from. IS there any way for me to achieve what I want to do?
I have a project created for me by teacher and I have to improve it. He created a repo on Git Hub with branch for me. I'm trying to pull the project files from that branch directly to Xcode and Xcode refers to the branches that I have created which are empty, not the master one. Can't find any adequate manual for that as well... Please help...
so github uses git to manage repositories, so this question has more to do with git than with github.
Git is a distributed-repository source-control system, which means that every machine has a full copy of the repository, with all of its history and branches. This means that your local repository that you cloned from GitHub has all of the branches on it.
So, your problem is actually just that you need to switch branches locally to the branch your professor created.
In a terminal you can execute
git checkout <the-name-of-the-branch-your-teacher-created>
and that should do it. :)
Xcode is simply looking at the files in your working directory, so switching branches will update the files in Xcode as well.
For more git information check out the git book or any of the other countless git resources online!
Well using Git is fairly simple and as specified above can pull the project (either complete of specific brach and then import it.
OR
While running Xcode you can follow below steps -
Click on Check out an existing project.
Enter Repo link as shown below and hit Next.
Select the branch that you want to pull and hit Next.
Note As shown in Image Xcode version 8.2.1 is used.
I'm writing an app in xcode, and I'm using git (though using the github app to commit and manage it, not xcode) for version control.
I use PXSourceList in the project, which I've cloned to my computer. I include the files as references in Xcode, so this means they aren't part of my git repo which syncs to github. So if someone were to download or clone from github they wouldn't be able to build without getting PXSourceList themself. How do I include PXSourceList, so that it is "referenced" in my repository?
Both on my computer (to my local clone) and on github (to PXSourceList on github)? So that PXSourceList will stay up to date in my repo when changes are made to it by others independant of my repo?
Subrepo or git-subtree. You have to move PXSourceList into your project tree in both cases
After following several tutorials I was finally able to take my existing, non-Git-Repository XCode Project and get it uploaded to a repository on BitBucket. I'm completely new to git but I'd like to start working with versioning. Since I'm a complete newb I'd rather not be working with the command line all day (which is what I had to do to get the project on BitBucket).
XCode's organizer now has access to the BitBucket repository. I successfully cloned the project back to my hard drive. My question is this: From now on, will the projects be in sync with each other? I'm not familiar with the lingo, and the difference between a branch and a fork. Essentially, I uploaded a 1.0 codebase and I want to start working on 1.1. I'd like to either fork the code or branch it so that the original project remains for reference. From what it appears, when I clone to my hard disk, XCode creates a new local repository instead of saving it on BitBucket.
I'm confused, please help!
Forking is a server-side operation where you clone the repo. For BitBucket, it is generally used with Mercurial (see "Forking a Bitbucket Repository").
This isn't what you have done.
You have simply cloned your BitBucket Git repo (now that BitBucket also support Git, and not just SVN and Mercurial) into a local repo and imported it in your XCode editor.
You can check it through command-line (git remote) or in XCode (See "Version Control System with XCode 4 and Git").
Note that you need to use an https address for your BitBucket clone address for being able to push back to the BitBucket repo from your XCode-managed local repo: see "Bitbucket + XCode 4.2 + Git".
For more on the basis of Git (especially branches), you can follow first the small labs from gitimmersion.com.
What you want to do is Branch your code from your 'master' i.e. your 1.0, to a 'develop' branch i.e. your 1.1 version. This is the simplest way for you to start getting used to version control. Once you create the branch using Xcode, the project in Xcode you are working on locally will be on that branch.
As you make changes to the code on that branch, 'commit' them from Xcode, and then 'Push' them up to Bitbucket (all done from the same menu in Xcode File>Source Control>...Xcode will ask during a push which branch to send changes to so make sure you select your Develop branch.
This will keep your local copy and your remote repo in sync as you develop your code.
This chapter in the Xcode user guide helped me immensely:
https://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/SCM/SCM.html
How often you should do the commit and push dance will come from experience.
Good Luck.