5/29/2015 - 10:04 PM

How to use Github in different IDEs

How to use Github in different IDEs

1. Launch XCode 4

2. Select the ‘Connect to a repository’ option from the ‘Welcome to XCode’ dialog.

3. Paste in your GitHub SSH URL in the Location text box. This can be found from your GitHub repository’s Source page. e.g.<organisation>/<repository>.git

4. Click Next and then give the repository a name (e.g. RepositoryName) and click Clone.

5. Pick a directory to clone your GitHub repository into (even if your repository is currently empty).

6. The 1st attempt appears to fail even though contents are downloaded. Click ‘Try Again‘ and XCode 4 is happy and shows a green tick icon.

7. Close the dialog. There is now a new Repository defined in the Organizer window (Shift+Cmd+2) with its origin set to the GitHub remote SSH URL.

8. Create a New Project within the directory you just cloned into but do not tick the ‘Create local git repository for this project‘ option.

9. Do an initial commit to the local Git repository. You can either choose File -> Source Control -> Commit or press Option+Cmd+C. Enter a commit message and click ‘Commit’.

10. Now try  to push your local changes up to GitHub. From the application menu, select File -> Source Control -> Push. XCode 4 fails with ‘The operation could not be performed because access to the repository <RepositoryName> was denied. Check username and password‘ (where RepositoryName is the name you entered earlier).

11. Try pushing again by selecting File -> Source Control -> Push and XCode 4 pops up the remote Repository dialog again. This time it has detected a remote Repository called origin. Next to it there’s a yellow ball and the message ‘Authentication required‘.

12. Clicking ‘Push’ again causes the remote Push to work.