Thursday, October 9, 2014

What happens when you select 'Create Git repository on..' in Xcode.

When you create a new project in Xcode, you have an option of selecting 'Create Git repository on..'.

 

    I'm still fairly new to Xcode (compared to my 15+ yrs with Visual Studio), and wondered what exactly happens. What I mean by that is by default you can't see where the Git repository was created and that's because it's hidden. Every time you select 'Create Git repository on 'My Mac'' Xcode creates hidden Git folder in the same folder as your project. To be able to see it (in Mavericks) open terminal window and type:
defaults write com.apple.finder AppleShowAllFiles TRUE
Hit Enter and type:
killall Finder
You should now be able to see the hidden Git folder inside your project:



To revert that behavior and re-hide the files type:
defaults write com.apple.finder AppleShowAllFiles FALSE
Hit Enter and type:
killall Finder
That's all.