A step-by-step guide for backing up an existing Xcode project to GitHub without using the terminal. This guide uses the updated "Integrate" option from Xcode 15 (used to be under "Source Control").
- Open Safari.
- Navigate to GitHub at https://github.com/.
- Log in to your GitHub account.
- While logged in, click the + icon in the top-right corner and select New repository.
- Important: Name the repository exactly the same name as your Xcode project folder (e.g., MySwiftApp).
- Important: Leave Initialize this repository with a README unchecked.
- Click Create repository.
- Open your project in Xcode.
- Go to the menu bar and click File > Integrate > New Git Repository.
- Choose the location (usually the root folder of your project) and click "Create".
- Open Xcode Settings (formerly Preferences) by clicking Xcode > Settings from the menu bar.
- Go to the Accounts tab.
- Click the + button in the bottom-left corner and select GitHub.
- Log in to your GitHub account. Enter your credentials or use a personal access token (if required).
- Ensure your GitHub account is visible and connected.
- In the Xcode navigator, select the Source Control Navigator (icon with two branches, usually on the left panel).
- Locate your project under Local Repositories.
- Right-click your project and select Configure Remotes....
- In the Remotes section, click Add Remote.
- Enter the following details:
- Name:
origin
- URL: Copy the repository URL from your GitHub repository page (e.g.,
https://github.com/yourusername/MySwiftApp.git
).
- Name:
- Click Add to save the remote repository.
- In Xcode, go to Integrate > Commit... from the menu bar.
- Review the changes you’ve made (your SwiftUI files should be listed).
- Write a descriptive commit message, such as
Initial commit
. - Click Commit to save the changes locally.
- After committing, go to Integrate > Push....
- Select the remote repository (
origin
) you added earlier. - Click Push.
- Your project is now saved on GitHub!
- Go back to your GitHub repository page in the browser.
- Refresh the page to see your code uploaded.
- Commit your changes often to track progress.
- Use descriptive commit messages to explain what you've done.