28.12.2020

How To Upload Files To Github Mac App

GitHub
Warning: This guide is now outdated since Xcode has changed a lot since it was first published. A new version of this guide, Using GitHub and Xcode Together, is available and is based upon Xcode 10.1.

Developers are always talking about whether to use Git from the command line, or via a GUI such as GitHub Desktop. Well, if you’re using Xcode, then there’s a much simpler method that’s already built-in! It’s called Xcode Source Control[1].

How to upload files to github repository

I’m just about to upload one of my projects to GitHub, so I thought I’d share the process. Especially as I’ve recently found it so much easier to use, because it’s right there in Xcode! /google-messages-mac-app.html.

Step 1

With setting macos-latest you can use mac OS on GitHub Actions workflow. It allows us to use Xcode command-line tools. (actions uploadtoappstore and deliver). Push the workflow file to. It can be local to a folder on your computer, or it can be a storage space on GitHub or another online host. You can keep code files, text files, images or any kind of a file in a repository. You need a GitHub repository when you have done some changes and are ready to be uploaded. This GitHub repository acts as your remote repository.

The first step is to let Xcode create a Git repository on your Mac. It should be checked by default.

Step 2

Then you will need to create a new repository on GitHub. Give it a name, description, and make it Public/Private. But make sure you don’t select “Initialize this repository with a README”.


Then select “Create Repository”.

Step 3

Then you’ll be redirected to a page where you’ll be asked to set up your repository. You only need one thing from this page, and it’s the URL in the Quick Setup section.

In my case, this is https://github.com/chrishannah/CH-Work-Item.git.

How To Upload Files Using Github Desktop

Step 4

Now it’s time to add this into Xcode.

Simply select Source Control from the menu bar, your project name, and then select the “Configure project” option.

Files

Once you’ve done that, the next step is to select the “Remotes” tab, then select the + button in the bottom-left corner, and select “Add Remote”.

Here you will need to give it a name, and an address. The address is the URL previously found on the GitHub set up page. Then press “Add Remote”.

Step 5

Uploading Files To Github

The repository has now been created on GitHub, and added to Xcode, the next step is to initialise the repository.

Again, from the menu bar, select Source Control, and then Commit.

A window will appear with all the changes to the repository, since this hasn’t been initialised yet, it will show all of your projects files.

Simply add a commit message, select “Push to remote”, which should automatically select your GitHub repository, and press “Commit X Files and Push”.


If you haven’t connected your GitHub to Xcode before, you will be prompted for a username and password, these are your GitHub details.

That’s It!

Once you’ve completed all of the previous steps, your project should now be on GitHub, and if you go back to the repository on GitHub, it should now be populated.

If you haven’t already (like me above), it’s probably best to add a README file.

Managing Your Repository

From here it’s really easy to manage your repository in Xcode. It’s all found in the Source Control menu.

From there you can commit new files, push them to GitHub, pull any new changes, and anything else you’d expect from a Git client.

I hope that this guide proved useful, and provided a bit of piece of mind for you knowing that your project is now essentially backed up.

How To Upload Files To Github Repository

If you want to see the other tutorials I have here, then there is a Guide section.

You can find me on GitHub as chrishannah.

  1. For more information, there is a session from WWDC 2013, “Understanding Source Control in Xcode” that explains this in more detail ↩︎