1

GoogleService-info.plist, Development.xcconfig, and GlobalVariables.swift have all been added to the projects .gitignore file.

Upon cloning the project from GitHub, all of the ignored files in the setup folder are greyed out.

The files should not be contained in git, as developers are to create them upon cloning the repo, add their own private keys (based on their own firebase backend), in order to do local development.

Issue #1: Currently, the ignored files still appear (but greyed out), and developers must first delete the files, before recreating them. (this is due to the ignored files still persisting in the project.pbxproj file).

Issue#2: The deletion & recreation of the files causes a change to the projects' project.pbxproj file, specificically, the files are recreated in project.pbxproj with a different fileRef number.

Issue#3: Merge conflicts due to different fileRef numbers:

If two developers both clone the repo, both delete the 'greyed out' files and recreate them, the recreated files will have a different fileRef in the project.pbxproj file.

Each developer will have to perform an additional commit to account for the changes in the project.pbxproj file, and upon pushing the code to the remote repository, there will be a merge conflict in the project.pbxproj file.

The goal of adding the files to .gitignore was to keep each developers added code secrets out of git (Which it is still currently accomplishing).

However, is there a way to ensure that files added to .gitignore are also kept out of the ```project.pbxproj`` file?

Goals:

1) The files in .gitignore should not appear in the Setup folder upon cloning.

2) The creation of the files that have been added to .gitignore should not be added to the project.pbxproj file at all

3) Developers should effectively be able to clone the repository and create the setup files without any changes occurring in Git.

Any feedback on how to accomplish this is appreciated in advance.

To Clarify:

The files added to .gitignore are properly being ignored by git, the issue is that the created files are still being added to the project.pbxproj and persisting there, where they ideally should not be.

Jacob Sock
  • 11
  • 4
  • @GoodDeeds Thanks for the quick response, however, I do not believe that is the issue. All of the files that have been added to ```.gitignore``` are indeed being properly ignored in git, and are not being tracked. However, the creation of the files in Xcode is still creating a ```fileRef``` in ```project.pbxproj``` and I am unable to add the entire ```project.pbxproj``` file to ```.gitignore``` as it is essential for the build. – Jacob Sock Nov 15 '19 at 16:16
  • Oh I see, sorry, I had misunderstood earlier. I have removed my comment. – GoodDeeds Nov 15 '19 at 16:21
  • no, you cannot control contents of `project.pbxproj` and it's a known pain when dealing with git. The solution is to switch to using Swift Package Manager. See: https://stackoverflow.com/a/8026488/5318223 – timbre timbre Nov 15 '19 at 16:29

0 Answers0