Importing a Tailored Swift .gitignore File From Github to Your Xcode Project

In this post, I will show you how to import a .gitignore file tailored for Swift provided by GitHub and contributed by other Swift developers.

I am going to assume you already have a project folder on your local machine and have created a .gitignore file inside.

Let’s open up the .gitignore file by typing open .gitignore in terminal. This should open the file in text editor. Next, navigate to the tailored Swift.gitignore file hosted on GitHub by clicking here. Once you get to the Swift.gitignore file, click on the pencil icon on the right to enter Edit mode.

Highlight all the contents in the file, copy and paste it to the .gitignore file you created in your project folder. Once you paste in the text, click File > Save to save your file.

And that’s it! From here, you can modify the file to your preference in what you would or wouldn’t like Git to track.

Happy coding!

Aspiring iOS Developer from Houston, TX.