Documentation on how to use Git as an iOS developer can be found in this repository's wiki.
- Go to https://github.com/BloomInstituteOfTechnology/ios-git-setup.
- Click Clone or Download.
- Choose Download ZIP.
- Open the resulting folder (
ios-git-setup-master), and leave it to the side.
- Go to https://macromates.com/, and click
Download. - Drag the app to your
/Applicationsfolder. - Open Textmate.
- Go to the Main Menu, and choose Textmate > Preferences….
- Go to the Terminal tab.
- Click Install.
This will allow you to use Textmate to edit git commits, and use other interactive features without needing to learn the ins and outs of vi/vim.
To make sure it works, do the following:
- Open Terminal.
- Type
mate .at the command prompt.
A Textmate window should open. You can close it without saving.
- Open the provided
gitconfigfile with Textmate (or any other text editor).
Note: If you get an error indicating “gitconfig” can’t be opened because it is from an unidentified developer., click ok, and do the following:
- Open System Preferences.
- Navigate to Security & Privacy
- At the bottom, there will be a message that says
“gitconfig” was blocked from opening because it is not from an identified developer. - Click Open Anyway
- Change
<Your Name Here>on line 2 to be your name:- From:
name = <Your Name Here> - To:
name = Dimitri Bouniol
- From:
- Change
<youremailhere>on line 3 to be your email (the one you use with GitHub):- From:
email = <youremailhere> - To:
email = dimitri.bouniol@lambda.com
- From:
Note: If you've been using git for a while now, you can reference what you've been using by typing less ~/.gitconfig in Terminal
- Change
<shortusername>on line 10 to be your computer's short username:- From:
hooksPath = /Users/<shortusername>/.githooks - To:
hooksPath = /Users/dimitribouniollambda/.githooks
- From:
Note: If you're not sure what your short username is, typing echo ~ in Terminal, and use whatever is printed out there as the value for hooksPath, adding /.githooks to the end of that:
$ echo ~=> /Users/dimitribouniollambda- So you should use
/Users/dimitribouniollambda+/.githooks=>/Users/dimitribouniollambda/.githooks
- Save the file.
3. Enable hidden files in Finder
- Navigate to the
ios-git-setup-masterfolder in the Finder. - Press Shift-Command-Period to enable/disable hidden files in the Finder.
- Rename
gitattributesto.gitattributes(with a.). If you can't do this, see the above step for toggling hidden files and try again. - Rename
gitconfigto.gitconfig(with a.). - Rename
githooksto.githooks(with a.). - Rename
gitignoreto.gitignore(with a.).
They should all be slightly greyed out now.
- In a new window, navigate to your home directory:
- Go to the Main Menu, and choose File > New Finder Window… to open a new window.
- Go to the Main Menu, and choose Go > Home… to go to your home directory.
- Locate any of the following files: (you will need to have hidden files visible — see 3. Enable hidden files in Finder)
.gitattributes.gitconfig.githooks.gitignore
- Rename them to not start with a
..
These files will not not be shaded out. You can now delete them if you'd like.
Note: If you also have a .git folder in your home directory, this was probably a mistake, and should probably be deleted. Reach out to your instructor for assistance.
- Find the window for the
ios-git-setup-masterfolder in the Finder. - Drag the following files (and one folder) from this window to the window with your Home directory:
.gitattributes.gitconfig.githooks.gitignore
Congratulations! git should now be properly set up on your system 🎉