Last modified 10 years ago Last modified on 2014-09-11 10:34:00

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.

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, 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