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
Download the Git for OS X installer (DMG file) here.
Once you successfully download the installer, open the DMG file, and then double-click on the PKG file to install it.
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
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.Give the key a filename. You can accept the default name by pressing Enter.
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
Find the key in the ~/.ssh hidden directory.
Use a text editor such as Microsoft Word, Notes, etc. to open the public key file. The default name is id_rsa.pub.
Copy the entire content of the key in preparation of pasting it into another window.
Log in to your Assembla account.
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
Go to your project's Git page.
If you are joining an existing space, you should first clone the repository.
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
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.
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
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.