You can create a local source code repository for a new or existing project. Later, you can create a remote from a local source code repository.
In Source Control preferences, click General, then select Enable Source Control.
Choose Source Control > Create Git Repositories.
In the sheet that appears, select the local project, then click Create.
Alternatively, you can create a local source code repository when you create a new Xcode project from a template. In the last sheet, select “Create Git repository on my Mac” before you click Create.