Skip to main content
Setting Up Git for OS X

Installing and configuring your Git repository on OS X

Toshi Dávila avatar
Written by Toshi Dávila
Updated over a month ago

Before installing and configuring your Git repository on OS X, you first must create a space and make sure you have a Git repository added to it. If you do not have it, you can easily add it by going to the Admin tab > Tools, and then clicking on the "add" button next to the Git tool.

Starting from scratch?

Install Git on your machine. To find out whether you already have Git installed, open a terminal, and then copy and paste the following command:

git --version

If you get a version number in response, that means you have Git already installed. You could skip the 'Install Git on your machine' steps and start configuring your username and email address. If you do not get a response, you will need to install git. Please follow the instructions below.

Installing Git on your machine

To install Git on your machine

  1. Download the Git for OS X installer (DMG file) here.

  2. Once you successfully download the installer, open the DMG file, and then double-click on the PKG file to install it.

  3. Follow the installation wizard to complete the installation.

Configuring your username and email address

Open a terminal, and configure your username and user email address. Copy and paste the code below, making sure to replace "Your Name" and "your_email@assembla.com" with your own name and email address.


IMPORTANT: Do NOT keep the quotation marks around your name and email address when typing the information into the terminal.

git config --global user.name "Your Name"
git config --global user.email "your_email@assembla.com"

Generating and uploading your SSH key

To generate an SSH key

  1. From Terminal, run the following command:

     ssh-keygen -t rsa -C "your_email@assembla.com"


    Note: This email address must match the email address you set up in the previous step.

  2. Give the key a filename. You can accept the default name by pressing Enter.

  3. Optional. Provide a passphrase. You can skip this step by pressing Enter.

Copying the public key (id_rsa.pub) into your Assembla Profile

To copy the public key into your Assembla Profile

  1. Find the key in the ~/.ssh hidden directory.

  2. Use a text editor such as Microsoft Word, Notes, etc. to open the public key file. The default name is id_rsa.pub.

  3. Copy the entire content of the key in preparation of pasting it into another window.

  4. Log in to your Assembla account.

  5. Go to Profile > Manage SSH keys, and paste the key from the clipboard before clicking Add key. You also can add the key using a file upload.

Starting Git

To start Git

  1. Go to your project's Git page.

  2. If you are joining an existing space, you should first clone the repository.

  3. Copy and paste the instructions into your terminal, but make sure you replace "space-name-here" with your space name (replace spaces with dashes).

    git clone git@git.assembla.com:space-name-here.git
  4. If you want to push your Git-tracked local directory to your empty Assembla Git repository, you first must push your code to the repository.

  5. Add a remote pointer to the repository. Make sure you replace "space-name-here" with your space name (replace spaces with dashes).git remote add origin git@git.assembla.com:space-name-here.git

    git remote add origin git@git.assembla.com:space-name-here.git
  6. Start using Git to push code.

     git push origin master

    Example:

Tip: Rename your Git repository before checking it out. In your Assembla Space, go to Git Settings and update your repository tab Title and Repo name to change your Git tab and repository URL to easily-identifiable names.

Have questions? Email us support@assembla.com

Did this answer your question?