Reputation: 10748
First of all sorry if my question doesn't make too much sense but this will be my first project where I will officially be using git for first time and I want to know how experienced people do it.
What is your work flow as far as what file you usually commit when developing new applications in iOS. The reason for my question is because usually when you create a new project in Xcode it creates a folder structure like...
AppName - AppName > AppDelegate.h > AppDelegate.m > main.m etc... - AppName.xcodeproj
1 - Do you create your git repository in the main folder or in the second one? 2 - Do you commit the .xcodeproj file? 3 - Do you commit all of the files and folders created by Xcode or only the classes you create and modified?
As I said, my questions may not make too much sense but I would like to hear what and how you start committing a new project, what's your git workflow when developing in iOS.
I guess part of my confusion and fear is that if I don't commit the necessary files and later on I want revert some changes I made and I want to go back to a certain point, I won't be able to since I didn't commit all of the files needed.
I will be doing this in the terminal.
Thanks a lot!
Upvotes: 0
Views: 451
Reputation: 447
Immediatelly after my project is created, I copy my default .gitignore
file (you can check the Gist below). This way I don't need to care much about what goes in the repo and simply commit everyhing that is not ignored (including xcodeproj folder - but excluding a subdirectory xcuserdata for example).
https://gist.github.com/anonymous/5425805
In case you commit a file that should not be there use git rm --cached
and commit the change. --cached
only removes your files from Git but keeps you local version in the working tree.
Upvotes: 2