UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Proper .gitignore use?

Forums > SwiftUI

Hi all,

I have a question about the best gitignore / github setup. I haven't used this file yet for Xcode (I use gitignore at work in Java)

Do we want to push up both the project folder, and the project.xcodeproj folder? Or just one of these?

Example: https://github.com/BillMoriarty/TrackPractice

thanks for any tips -Bill


You want to push both. The project folder contains all the files that make up your project; the .xcodeproj file (which is actually a package, i.e., a folder that macOS treats as a file, which is why it shows up as a folder in github) tells Xcode how to put them all together.


@twostraws  Site AdminHWS+

If you're shipping an app for iOS, macOS, watchOS, or tvOS, you should upload your xcodeproj file and the project directory. If you're building a simple executable using Swift Package Manager, you can skip the xcodeproj and users can make that themselves if they need it. The vast majority of folks are in the first group!


Hacking with Swift is sponsored by Superwall

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.