Skip to content

1. Principles and Practices

GIT & VERSION CONTROL

The first thing we did was download git from homebrew. I learnt that git is a version control software that basically saves all the edits and changes you make, or what is called commits. Git is a software that runs on the Mac terminal and is connected with Gitlab or Github which are essentially the cloud that stores the history of code.

GIT REPOSITORY

Open the terminal on mac and download GIT using the following code:

$ brew install git

The next step was to set up a git folder and repository on my mac that is connected to GtTlab. What I understood was that this repository is a local folder that in addition to storing data, stores the history of changes and is connected to the Gitlab cloud. In this step we need to connect the Gitlab and our local git software.

Setup your git username through your email address - git config –global user.name “tareqkhalaf12@gmial.com”

This is done through an SSH code/key which is a personal account that helps verify the local git software running on the mac to the cloud (Gitlab). This is done through the following steps:

  1. Add the user account to git through your personal email

2.Create the SSH key

in the terminal use the following command: ssh-keygen -t rsa -C “your_email@mail.com”

Cope your keygen and take it to GITLAB (follow instructions: https://learn.fablabbcn.org/fabacademy/classes/01-ProjectManagment/#:~:text=by%20following%20this-,guide,-git%20%2B)

this is how you make a SSH secure connection between local repo. and GitLab server!

Test local git funtion in terminal

Key commands: git status: checks the status of git git add: Stages the changes/updates we want to commity git pull: copies git commit: Commits the changes to the public site

Setting up McDocs

After the Git is set up with a local repository that is connected to GitLab. We can then download McDocs which is a simple but efficient coding language. This is a simple tool that allows for web development and allows beginners to write in a language called Markdown. We can install Mcdocs through simple typing the following command in the terminal:

curl -LsSf https://astral.sh/uv/install.sh | sh

Cloning local repository

This step will clone a local repository from the online repo. which is the storage space we have. To do this follow the following steps:

  1. Go to your personal repository on GITLAB
  2. Click the clone button to the right of your name
  3. Selected Clone with SSH

Now open terminal and do the following:

  1. Create a local folder on the desk-top
  2. Run the following command:
  3. git clone git@gitlab.com:your.username/fabacademy.git
  4. Add the URL you genorated next

This should connect the local folder to the repository!