Version control systems are software tools that help teams manage changes to source code over time.
Ref:[What is version control](https://www.atlassian.com/git/tutorials/what-is-version-control)
2. Git And GitLab
2. Git and GitLab
---
https://git-scm.com/about
Git is an open source distributed version control system.
GitLab is a web-based Git repository for faster and more efficient collaboration of software code.
FabAcademy uses a self-hosted version of GitLab on FabCloud at [gitlab.fabcloud.org](gitlab.fabcloud.org), which is were all projects related to the academies and student documentation websites are hosted.
FabAcademy uses a self-hosted version of GitLab on FabCloud at [gitlab.fabcloud.org](gitlab.fabcloud.org), which is where all projects related to the academies and student documentation websites are hosted.
Ref: [Git](https://git-scm.com/about)
3. Setting up Git for FabAcademy documentation
---
Since I had already created used git before, I found my existing SSH key using `~/.ssh/id_rsa.pub`
Setting up Git, GitLab for documentation takes multiple steps for the first time.
To start.
1. Install Git on your computer.
Install Git on the Terminal app (macOS).
Install [Homebrew](https://brew.sh/), a package manager using the instructions on the website.
[](./images/pppm/brew.png) and then
`brew install git`
There are other ways to install git as mentioned on the website too.
Ref:https://git-scm.com/download/mac
2.
On Fabcloud our individual repositories are housed under Academany > FabAcademy > Year > List of Labs > Lab > Students > Name.
One way to log on to Fabcloud is use login credentials from fablabs.io. That is also what you use for other FabAcademy communication.
If you are using GitLab for the first time, you need to generate a SSH key first. This is a securely connects your local
This repo consists of the default student template. First task is to clone this existing template to your local repo.
Then I cloned the default repository on Gitlab to a local folder using:`git clone git@gitlab.fabcloud.org:academany/fabacademy/2020/labs/barcelona/students/mitalee-parikh.git`
[](./images/pppm/clone.png)
Since I had already created used git before, I found my existing SSH key using `~/.ssh/id_rsa.pub` on Terminal.
This helps in tracking who makes the changes on the shared gitlab repo which is public.
Then I cloned the default repository on Gitlab to a local folder using:`git clone git@gitlab.fabcloud.org:academany/fabacademy/2020/labs/barcelona/students/mitalee-parikh.git`
4. Basic workflow and repository structure
---
I've used git a little for my Master's documentation. But till now, just used some basic commands like:
`git clone` Clone a repository into a new current local directory
You will most likely be using this workflow for git
Pull-add-commit-push
Download the last copy from the online repository and merge it with your local working directory:
git pull
Add the new files you added to git
git add index.html
or to review each sloc:
git add -p
Now name your update, so you know what you changed with this push.
git commit -m "COMMIT MESSAGE"
Upload to the Repository
git push
`git init` Create an empty Git repository or reinitialize an existing one (starts a .git folder on local computer where all changes will be saved)
`git status` to check what's happening with the current directory