| title | Share your Xcode project with Git and Azure Repos |
|---|---|
| titleSuffix | Azure Repos |
| description | Learn how to share and collaborate on Xcode projects using Azure Repos with modern authentication methods including Microsoft Entra ID tokens and SSH keys. |
| ms.assetid | f1fedd72-d9b9-45cf-99aa-2e624c899c45 |
| ms.service | azure-devops-repos |
| ms.topic | how-to |
| ms.date | 07/02/2025 |
| monikerRange | <= azure-devops |
| ms.subservice | azure-devops-repos-git |
| ms.custom | sfi-image-nochange |
[!INCLUDE version-lt-eq-azure-devops]
This guide shows you how to share your Xcode projects using Azure Repos.
[!INCLUDE azure-repos-prerequisites]
Choose the authentication method that best fits your workflow:
| Method | Best for | Setup complexity | Security |
|---|---|---|---|
| SSH keys | Individual developers, long-term use | Medium (one-time setup) | High |
| Microsoft Entra ID tokens | Enterprise environments, temporary access | Medium | Very High |
| Personal Access Tokens | Specific scenarios, automation | Low | Medium |
Tip
For most developers, SSH keys provide the best balance of security and usability with Xcode. Set them up once and they work seamlessly.
Create a local Git repo for your code to manage your project in version control.
Choose the option that matches your situation:
- New projects - Creating a new Xcode project
- Existing projects - Adding Git to an existing project
Note
If your project is already in a local Git repo, skip to Create a new Git repo in Azure Repos.
Create a local Git repo when you create a new project. Choose Create Git repository on My Mac when creating a new project.
Create a local Git repo for your existing projects not in version control by going to Source Control, Create Working Copy... . Select the projects to add to the local Git repo and select Create. Xcode creates a Git repo for your code and adds a commit with your project files.
Create a new Git repo in Azure Repos for your Xcode project.
Note
If you already created a repo for your Xcode project in Azure DevOps, skip to Connect and push your project.
-
In your Azure DevOps organization, go to your project and select the dropdown
next to the current Git repo name. Select New Repository. -
Enter a name for your new Git repo and select Create.
-
Copy the clone URL from your new repo. Choose the URL format based on your authentication method:
- SSH: Use the SSH clone URL (if you set up SSH keys)
- HTTPS: Use the HTTPS clone URL (for tokens)
[!TIP] Choose your authentication method:
- SSH keys (recommended for simplicity): Set up once and works seamlessly with Xcode. See Use SSH keys.
- Microsoft Entra ID tokens (recommended for enterprise): Modern, secure authentication. See Microsoft Entra ID authentication.
- Personal Access Tokens: Alternative method for specific scenarios. See Personal Access Tokens.
When using SSH, use the SSH clone URL when configuring your remote.
Now connect your local Xcode project to Azure Repos and push your code.
-
In Xcode, go to Source Control and select [Project name] -- main, then Configure.
-
In the Address field, paste the Git clone URL you copied earlier. Select Add Remote, then Done to create the
originremote. -
Go to Source Control > Push, enter the branch name on
originto push to (usuallymain), and select Push. -
If prompted for credentials, choose your authentication method:
[!IMPORTANT] We recommend using SSH keys or Microsoft Entra ID tokens for secure authentication. Only use personal access tokens when other methods aren't available.
If you configured SSH keys, Xcode authenticates automatically. No other credentials needed.
For Username: Enter your Azure DevOps username. For Password: Use a Microsoft Entra ID access token.
# Get token using Azure CLI az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv
For Username: Enter your Azure DevOps username. For Password: Create a Personal Access Token with Code (read and write) scope.
Select OK to complete authentication.
After successful authentication, Xcode pushes your project to Azure Repos. Your code is now available for your team to collaborate on.
Tip
Once you set up authentication, future pushes and pulls use the same credentials automatically.
[!div class="nextstepaction"] Learn Git workflow fundamentals





