Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git not able to recognise addition of .xcscheme files in xcode project

Added a new scheme corresponding to a test target in my xcode project. The new xcscheme file created is not getting reflected in git. Also doing a git status shows me nothing to commit, working directory clean .

Trying to add it through terminal by git add .xcscheme says

The following paths are ignored by one of your .gitignore files: MyProject.xcodeproj/xcshareddata/xcschemes/MyProjectTests.xcscheme Use -f if you really want to add them

On verifying my .gitignore file, its completely blank.

I went through posts which asks to make the schemes shared but it did not help. Went through this thread, Bitbucket not showing changes in themes directory . But for me, there is no .git or .gitignore files inside either of the .xcodeproj file or xcschemes directory.

How to remove these restrictions so that I can add the new xcscheme file to the repo or is there any other settings that I need to modify?

like image 334
Shane D Avatar asked Sep 24 '15 05:09

Shane D


People also ask

How do I create a git repository in Xcode?

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.

How to fix “Git is not recognized as an internal command”?

If the Git path is not configured correctly, you could also receive the error “git is not recognized as an internal or external command, operable program or batch file”. You can try reinstalling Git for Windows to set the path automatically. Step 1: Open the Search utility and search for Control Panel. Then open it.

How do I connect to VSTs using Xcode?

Copy the clone URL to the clipboard so that you can use it in Xcode to connect to VSTS. If you want to use SSH to connect to your Azure Repos/TFS Git repo, Set up SSH credentials and use the SSH clone URL when adding the remote for your local Git repo. Go to Source Control in Xcode and select Projectname -- master, then Configure...

How do I push a git repository to Another Git repository?

Push your project Go to Source Control in Xcode and select Projectname -- master, then Configure... Select Remotes, then select the icon and choose Add Remote... In the Address field, paste the Git clone URL for your repo copied in the previous step. Go to Source Control, Push..., enter the branchname on origin to push to, and select Push.


1 Answers

You'll need to go into the "Manage Schemes" view and check off the 'Shared' checkbox

'Product' menu -> Scheme -> Manage Schemes

That will create the shared scheme files. Next, you'll need to make sure the files are not ignored by git.

You'll need to remove 'xcshareddata/xcschemes' from your ignore file and add them to the repo

or just use

'git add -f MyProject.xcodeproj/xcshareddata/xcschemes'

like image 99
Sultan Ali Avatar answered Nov 15 '22 21:11

Sultan Ali