Git is a version control software. It keeps track of changes made to files in a directory, and synchronizes those changes between user's computer and the online repository.
Getting started - first-time git setup
Open a terminal window (Ctrl+Alt+T)
sudo apt-get install git
Configure git with gitlab account (replace user and email with the ones from the previous step)
git config --global user.name"your-git-user"
git config --global user.email "your git email"
An ssh key is an identifier for the computer, to grant permissions to connect to a server, for uploading files to the git account. This key must be generated in the user's system (GitHub help).
Generate ssh key (Filename: default | passphrase: empty)
ssh-keygen -t rsa -b 4096 -C "your git email"
Start ssh agent
eval "$(ssh-agent -s)"
Add ssh key
ssh-add ~/.ssh/id_rsa
Display ssh key
cat~/.ssh/id_rsa.pub
Select and copy (CTRL+SHIFT+C to copy)
Sign in to gitlab fabcloud.
Go to settings, then "SSH keys" option on the left and paste the key on the text area (CTRL+V to paste the key)
Create an empty folder to clone the git repository to (let's suppose you created it inside the Documents folder).
Open a terminal window (Ctrl+Alt+T)
Navigate to that folder (on ubuntu terminal) (use cd command [change directory])
cd Documents/"folder you just created"
Note: This folder must be empty.
Clone git repository to that new empty folder (when finished, this folder will contain a copy of the git repository).
git clone git@gitlab.fabcloud.org:academany/fabacademy/##this_year##/labs/stjude/students/##your_name##.git
Navigate to the new site folder (identified by your name).
You can now start worling on your site, or empty the folder and start from zero.
Go back to the terminal.
git add .
git commit -m "< message >"
git push origin master
For the next commits, the commands are:
Use "cd" command to go to the repository folder on your computer, and to the folder with your number.
Update the files in your folder with the latest files of your site.
git add .
git commit -m "< message >"
git fetch origin
git rebase origin/master
git push origin master