Adding Source Control to an existing Xcode project

I want to "add" Source Control to an existing Xcode project. I have created a new local Git repository using the Source Control menu, but apparently I need to add the 3 files and two targets in the project to the list of files -- the repository is empty by default.

Question: How do I add my project and files to the new local empty repository? Xcode 13.3 beta 3. The menus are greyed out.

Back up your project before doing anything else so you have a copy to go back to in case things go wrong.

In the Finder press Cmd-Shift-Period. Doing this will show hidden files and folders in the Finder. Pressing Cmd-Shift-Period a second time will hide the hidden files.

Go inside your project folder. There should be a hidden folder with the name .git. That folder contains the git repository. The files and folders in your project must be in the same folder where the .git folder resides, the project folder, for git to track the files. DO NOT put your project files inside the .git folder.

The left side of the project window has a list of the project's files. Do any of the files have a question mark next to them? If they do, select the file, right-click, and choose Source Control > Add Filename from the contextual menu to add the file to the repository. If the file has an A next to it in the project window, you will have to commit the file to finish adding the file to the repository.

If none of the files have a question mark next to them, you're going to have to show the contents and structure of your project folder for anyone to solve the problem. Somehow the contents of your project are not inside the project folder. As a test I created an Xcode project without a git repository and added a git repository through Xcode's Source Control menu. The project file had a question mark next to it, and I added the file from the contextual menu.

Adding Source Control to an existing Xcode project
 
 
Q