I have search everywhere but I can't find information on how to create a branch in Versions for Mac. How is this done?
There was very little information on this but I found the answer. Just press Option key and drag the trunk into the branches folder
The option key opens the Move dialog and copies the source to the target, then deletes the source. You can Duplicate the project first, then option/drag to Move the duplicate to the branches folder.
A branch or tag is simply a copy of the trunk, or in some cases another folder, in your Subversion repository. To create one, use the “Browse” view to navigate to the right place in your repository and drag the trunk of your project to the “branches” folder while holding down the “Option” (alt) key on your keyboard. When you drop the trunk, a dialog will open asking you to name your new tag or branch.
Related
When I start a new project with GitHub I always struggle with the same issue. When I create a GitHub project it's already prepopulated with some files (.gitignore, LICENSE, README.md) and hence with an initial commit. I explicitly choose to add these items so I don't have to care about writing them myself.
On the other side, when I start a new Xcode project it works in a very similar way: Xcode creates an initial commit with some files. So when I'm trying to pull my GitHub repo I always have to deal with Git refusing to merge unrelated histories problem.
Is there a correct workflow for this?
Here is the easy way to do this, assuming that you are using a recent Xcode, e.g. 11.2...
create new repository in GitHub, checking .gitignore file and README.md file options
copy repository URL from browser's address field
create new project in Xcode, checking local git repository option
right click Remotes in project's source control navigator to add remote, using URL copied earlier, suffixed with .git
select Fetch and Refresh Status from Source Control menu
select Pull from Source Control menu, from origin/master remote (.gitignore and README.md files are now in your local repository... if in Finder, use Command Shift . to toggle hidden files display)
select Push from Source Control menu, to origin/master remote (Xcode project files are now in your GitHub repository)
Voila! You have set up a new project in Xcode and GitHub in less than a minute.
Just came across the same issue. It actually works on Xcode 11, if you follow these steps:
Create the repository on GitHub including initial branches, License, Readme.md etc.
At the Welcome screen of Xcode choose "Clone an existing project"
Clone your repository into the desired directory (usually a subdirectory of XCodeWorkspaces)
Close Xcode and reopen to get back to the Welcome Screen (that's the trick)
This time choose "Create a new Xcode project"
Place the project into the cloned directory. Xcode automatically picks up, that this directory is already under Git control.
You'll see that the initial files are marked with A and M in the Xcode project navigator
In the menu "Source Control" choose "Commit". You should see all files created by Xcode. Make sure to activate on "Push to remote:" and choose the right branch. Press Commit
If nobody committed or changed on GitHub between step 1 and step 7, it'll work. Check on GitHub.
When trying to setup the source control feature in Xcode in an existing project, I changed branch to the one situated at github, but as I did that all my code disappeared an now I am not able to open the project as it says cannot be opened because it is missing its project.pbxproj file. Can I somehow switch back to my local master branch and recover my project? :(
For me, neither the issue or solution had anything to do with a source control repository. Somehow the project folder permissions got screwed up. To fix it, I opened the folder containing the project, did "Get Info..", clicked on the lock to unlock it, clicked on the gear icon near the bottom of the pane, and selected "Apply to enclosed items..." This reset the permissions throughout the project folder, after which I could open the project.
What has happened here is that you checked out a branch that does not contain the xcode project (or at least not all its components).
yes, you can switch back to the master branch and have everything that is in master including the project (assuming it was committed prior to master)
considering your problem you may need to use terminal to checkout master. in that case open terminal and cd to the project directory and do git checkout master
So this problem already helped me solve another one of our issues, but I still haven't figured this one out. (This is relevant. Hold on.)
I am developing a game with one other person. Neither of us have ever used git repositories, Github (for more than reference) or any sort of version control before, and we've had some trouble getting set up.
We have our project set up in Xcode with remotes to a GitHub repo, and everything is working fine with the code. The problem is that we can't get our images (buttons, backgrounds, animations etc.) to commit to our local repo without resorting to one of two, very roundabout, methods.
Right click on our Assets group in Xcode and select Add Files to Project. I have to do this every time we add images anyway. Then, to get Xcode to realize that these are files that need to be added to the repo (at least to get the A indicator next to the files in the organizer) we have to go in and add a blank Objective-C class, then right click the images > Source Control > Add. Then delete the blank class.
Use the GitHub app to commit the project and push it from there. This isn't working because Github's .gitignore doesn't include the xcode preference files. This makes the project unable to commit from Xcode on any other machine, and even from the machine the commit was made from after a reboot. (This is the problem we figured out trying to commit images.)
So my question is: How do we share assets for the game? I figure that Xcode will do the same for sounds, we just haven't gotten there yet. Is there an easier way to get Xcode to recognize them? Or do we just need to add those user profile files to the .gitignore on GitHub? (And how do we do this?)
Every one using Git just has to watch these two videos:
Git For Ages 4 And Up
http://www.youtube.com/watch?v=1ffBJ4sVUb4
Advanced Git
http://vimeo.com/49444883
1) I've found the best way to add images to my Xcode project is to just create the directory structure I want in the Finder then just drag and drop them from my finder in to the proper group in Xcode Project Navigator. Multi select all the new files, right click (control-click on a laptop) and select Source Control -> Add
And Bobs your uncle!
2) I do not use the GitHub app, I use SourceTree and the GitHub website. I've 20 years experience with command line source control systems but Xcode and SourceTree are so good the command line is no longer a part of my daily workflow.
I create a new Xcode project and check Create local git repository for this project then I go to the GitHub create a new repository with the same name as my project's top level directory. Copy the GitHub url. Drag the new project directory into SourceTree's Bookmarks window. Double Click on the new project view in SourceTree. Right mouse click on REMOTES and paste the GitHub url and enter origin/master for the name. Click the big push toolbar button.
3) You need to add your user scheme and workspace file to .gitignore to push and pull from a remote you have to have a clean working repo. This is super simple with SourceTree just commit in Xcode and then open the project in SourceTree right click on the WorkspaceSettings.xcsettings and *.xccheme file and select Ignore... and it creates the .gitignore file for you. Now commit the .gitignore file and Push to the remote.
FYI: Check out SourceTree (http://www.sourcetreeapp.com) is's free in the Mac App Store. It's a very good GUI for Git. Atlassian makers of Jira acquired it and the original developer and released free to compliment the rest of there tools.
I can't figure out how to create a Subversion tag in Xcode 4. I would think it would be in the Organizer -> Repositories interface, but I can't seem to find a way. In Xcode 3, you could browse the SVN repository, click the "Copy" button in the window's top bar, and then specify the tags/ SVN directory. I don't see the same type of option in Xcode 4. Help?
My workaround for now is the command line:
svn copy trunkSourceUrl tagsDestinationUrl -m "My tag message."
Alas, as with the ability to merge branches, it would appear tags can't be managed in XCode 4 yet. This is a bit ridiculous considering that, programmatically, creating a tag is exactly the same operation as creating a branch. Guess we're stuck with terminal commands until Apple finally gets their act together about SVN.
Funny that it did work in XCode 3.
You need to go to the top level for your repository, and select it in the right pain of the Organizer. You will see where you put your username and password. Under that you will see fields to specify Trunk, Branches, and Tags. I just put trunk, branches, and tags (as that is customary for svn layouts). The jewels beside should change to green, and you will see folders for Trunk, Branches, and Tags popup under the repos on the right.
You correctly stated that it did work in XCode 3, and no longer works in XCode 4.
I guess you more or less answered your own question - you can still use XCode 3 for SVN copying, tagging and such. I just tried this, and it seems to work OK with XCode 4 open at the same time. You don't need to open any file or project in XCode 3 to be able to use the 'SCM' menu. Since you won't need to do this often (I guess), it's not a major issue to use two XCode applications at the same time for a short while; otherwise, this could get confusing.
Select the "Root->Tags" directory, create a new directory with the name of the release you want to tag e.g "MyGreat App 1.1"
Select the new directory and click "Import", then select your source code directory and click the "Import" button.
My company just imported our CVS repository into Perforce. I'm new to P4V and I can't work out how to create a branch from an existing label. Can anyone tell me how to do this?
In my copy of P4V (Version 2013.3), I go to the Actions menu and choose Branch Files..., which brings up the Branch Files dialog:
In that dialog, I specify the source files to branch, and the target name of my branch (in my case I am branching //depot/main/... to //depot/branch/...), and in the Filter tab I specify that I want to specify the source revisions using a label.
And I type my label name into the text box (If I don't know the label name I can Browse... for it).
Then I click the Branch button to make the branch.