61850

Add SCM to an Xcode project but meet an authentication issue

Question:

The situation is, I forgot to choose "use source control" in Xcode when creating my project. Then I found I can't update anything without source control selected, but also can't find where can add SCM to the project I've already created. Re-create a new project is a stupid idea, so if anyone met the same issue before PLZ gimme a hand :)

Update 1:

I tried command line to set up git repository and it succeeded. But just add git to project is not enough, you have to add it to the oragnizer as a repository so Xcode can find where to check out or update your code. Then I encountered another issue:

In Xcode 4 user guide it says:

<blockquote>

By abstracting common repository operations, Xcode supports both Git and Subversion (SVN) repositories with a single, unified graphical user interface and workflow. Depending on your choice, this one operation checks out (for SVN) or clones (for Git) the repository and integrates it with your project.

Cloning a Git repository in Xcode sets up a complete repository on your local system and integrates that repository with your workspace so that you can quickly start using it. This approach gives you the benefits of distributed version control, including full commit rights, whether you’re online or not.

</blockquote>

It also provides several steps:

<blockquote>

In the repositories organizer, click the Add button and choose Checkout or Clone Repository.

Enter the pathname or URL for the file.

When the “Host is reachable” indicator turns green, click the Next button.

Enter a local name for the repository and click Clone (or Checkout) to copy it.

Choose a location and click the highlighted Clone (or Checkout) button to save the local repository.

</blockquote>

When I went to step 3, a yellow lamp occurred instead of a green one and said "authentication required".

I clicked next button, and clone failed. Then it showed NOTHING, no error log or notice or anything else.

When I clicked previous button it also showed nothing, so I think it's a bug of Xcode Version 4.3.2 (4E2002).

Seems newbie can't post image... link below: T_T <a href="http://i.stack.imgur.com/jWXvx.png" rel="nofollow">http://i.stack.imgur.com/jWXvx.png</a>

<a href="http://i.stack.imgur.com/K6MqG.png" rel="nofollow">http://i.stack.imgur.com/K6MqG.png</a>

Update 2:

Besides, I also tried "Add repository" instead of "Checkout or Clone Repository". It gave me the same notice again, but after a short while I saw a green lamp. Unfortunately a label said "Unable to load revisions" showed at center of screen, and seems it still can't work.

I googled for these issues but can't find any valuable answer.

Update 3: I tried to restart my MAC and Xcode, then this problem fixed itself... it's very complicated...

Answer1:

If you want to use git as your version control system then go to your project folder on terminal and run these commands -

git init git add . git commit -m "Initial commit"

Or if you want to use SVN as your version control system then follow this

1) Use the mkdir command to create a directory with three subdirectories named branches, tags, and trunk to hold a temporary copy of your project.<br /> 2) Copy your Xcode project into the trunk subdirectory.<br /> 3) Use the svnadmin create command to create an empty Subversion repository.<br /> 4) Use the svn import command to import your project into the new Subversion repository.

examples -

mkdir /Repo_Master/Sketch_svn_tmp/trunk mkdir /Repo_Master/Sketch_svn_tmp/branches mkdir /Repo_Master/Sketch_svn_tmp/tags cp -R /Library/MyProjects/Sketch /Repo_Master/Sketch_svn_tmp/trunk svnadmin create /Repo_Master/Sketch_svn svn import /Users/myUserName/Projects/Sketch_tmp \ file:///Users/myUserName/Repositories/Sketch_svn -m "Initial import"

Answer2:

Please read the steps given in the <a href="https://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010215" rel="nofollow">xcode 4 user guide</a>

In this guide look for "managing versions of your project". They have given ways to add SCM (git & svn) to existing project using some terminal commands.

Answer3:

Finally I found the right step:

<ol><li>

Follow steps provided by @Saurabh.

</li> <li>

Just restart your Xcode, DON'T DO ANYTHING ELSE LIKE THE DOCUMENT SAYS AFTER, Xcode will find the repository itself, and manage it automatically.

</li> </ol>

Recommend

  • Why do so many apps/frameworks keep their configuration files in an un-executed format?
  • Should “DbContext” and “DbSet” be exposed for a pure POCO application
  • Microsoft Visual Basic in Visual Studio C#
  • Does using global variables increase or decrease performance, in C code compiled for ARM7?
  • SWIFT uiviewcontroller init
  • Some confusions about Command Line Compiler and MSBuild
  • Deploying Tizen app to Gear S2: Non trusted certificate is used
  • activity diagram - call operation example with parameters?
  • How to implement HTTPS in laravel 5.4
  • Gradle test fails with NullPointerException
  • How to import Navit into Eclipse and use it in own android project
  • Gforce min not supported for character in data.table
  • Mapping two workspace folders to the same working directory
  • Converting simple MySQL database to a NoSQL solution
  • calling a fragment from fragment
  • Entity Framework ObjectContext: Concurrency
  • Distributed JMS based logging .. falling flat?
  • Avoid registering duplicate broadcast receivers in Android
  • How to handle elastic beanstalk deployment so it uploads only changed files
  • How to get links to open in the native browser in iOS Meteor apps?
  • Check all values in string[] for length?
  • Create DicomImage from scratch using Dcmtk
  • print() is showing quotation marks in results
  • Make VS2015 use angular-cli ng at build time in a .NET project
  • Android fill_parent issue
  • How to do unit test for HttpContext.Current.Server.MapPath
  • If I include Java 8 in my Android app does that affect which devices it will work on?
  • Get object from AWS S3 as a stream
  • Deserializing XML into class C#
  • When should I choose bucket sort over other sorting algorithms?
  • Large data - storage and query
  • Timeout for blocking function call, i.e., how to stop waiting for user input after X seconds?
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • How to include full .NET prerequisite for Wix Burn installer
  • python regex in pyparsing
  • Android Google Maps API OnLocationChanged only called once
  • How does Linux kernel interrupt the application?
  • costura.fody for a dll that references another dll
  • How can I use threading to 'tick' a timer to be accessed by other threads?
  • jQuery Masonry / Isotope and fluid images: Momentary overlap on window resize