{{{ #!Markdown # Accessing the GIT repository ## 1. Download and install GIT ___[GIT for Windows][1]___ - Ensure to enable the Windows Explorer integration components when installing ("Git Bash here" / "Git GUI here"). ___[GIT for Mac OSX][2]___ - GIT mostly works with Terminal commands. The graphical tools are invoked with commands _gitk_ and _git gui_. If _git gui_ doesn't run (_"image not found"_) you need to install the TCL/TK libraries __version 8.5__, [available here](http://www.activestate.com/activetcl/downloads). ## 2. Clone the Vehicle Physics repository ___Windows:___ Right-click the folder where you want to locate the Vehicle Physics project folder (don't create it) and select "Git Bash here" from the pop-up menu. ___Mac OSX:___ Open a Terminal window, then type "cd Documents" so the project folder will be created inside your Documents folder. $ git clone http://projects.edy.es/git/edy/vehicle-physics.git Enter your username and password when prompted. GIT will download and set up the repository. Once the command is completed you'll have the project ready for Unity at the folder _vehicle-physics_. Feel free to move or rename the folder if you want to. ## 3. Working with GIT graphical tools ___Windows:___ Right-click the vehicle-physics folder created above and select "Git GUI here" from the pop-up menu. ___Mac OSX:___ Open a Terminal window, type "cd Documents/vehicle-physics", then "git gui". You can retrieve the latest updates anytime from GIT GUI at __Remote > Fetch from > origin__. The updates are downloaded to your local repository but don't worry, your files won't be overwritten. Go to the History window (__Repository > Visualize All Branch History__) to see what happened: the updates go to their own branch (_remotes/origin/master_), while your local changes remain in your local _master_ branch. You can merge them anytime (__Merge > Local merge__), or switch among them (__Branch > Checkout__, choose among local or tracking -remote-). Note that switching or merging branches requires your own changes to be __commited__ first to your local master branch. Select the changed files at the left-top box (_unstaged_), then __Commit > Stage to Commit__. Files are now at the left-bottom box (_staged_, which means they will be commited). Write a __Commit Message__ describing your changes, then click __Commit__. You can see the result at the History window (__Repository > Visualize All Branch History__). ## Advanced: Accessing the repository via SSH The above setup requires to enter your username and password each time that the remote repository is accessed. Configuring SSH access allows you to work with the remote repository without having to enter your login data each time. ___Windows:___ Right-click any folder and select "Git Bash here" from the pop-up menu. ___Mac OSX:___ Open a Terminal window. $ ssh-keygen -t rsa -C "your_email@youremail.com" Press enter on each prompt for leaving the default settings. Two files will be created at the subdirectory _.ssh_ inside your local user directory: id_rsa id_rsa.pub Open the [Vehicle Physics project page](http://projects.edy.es/trac/edy_vehicle-physics/), then click _My Profile > Public Keys > New Key_. Open __id_rsa.pub__ with a text editor (Notepad). Copy _all_ the text exactly as is without adding or removing anything. Then paste it into the __Value__ field. Give the key a name of your choice and click _Add key_. Now configure your name and email in GIT for matching the email you generated the SSH key with: $ git config --global user.name "Firstname Lastname" $ git config --global user.email "your_email@youremail.com" #### Cloning a repository using SSH $ git clone ssh://git@projects.edy.es/edy/vehicle-physics.git #### Configuring an already cloned repository to use SSH $ git remote set-url origin ssh://git@projects.edy.es/edy/vehicle-physics.git ## Configuring a repository cloned from Codaset to use the new location ___Windows:___ Right-click the project's folder and select "Git Bash here" from the pop-up menu. ___Mac OSX:___ Open a Terminal window, then _cd_ to the project's directory. Http (prompts for user and password on each remote access): $ git remote set-url origin http://projects.edy.es/git/edy/vehicle-physics.git SSH (requires configuring a SSH key, see above): $ git remote set-url origin ssh://git@projects.edy.es/edy/vehicle-physics.git [1]: http://code.google.com/p/msysgit/downloads/list [2]: http://code.google.com/p/git-osx-installer/downloads/list }}}