Starting with GIT
My Git journey starts whit an e-mail
The first step was to reset the password to have access to the GitLab repository files. once the password was changed, I was able to edit some profile data and explore the files:
Right away I was ready to edit but didn’t have Git installed, well, to be honest, did not known what Git was, so…
Tutorials and setting up GIT
Installed Git for Windows from the download page. While installing, I also downloaded the Pro Git Book and check up the video guides on the Git web. but to start setting Git in my PC I used the FabLabBCN guide to Git basics available here
Set up the credentials
Generate an SSH key and linking it to GitLab
The generate key command: $ ssh-keygen -t rsa -C "[email protected]" -b 4096
When the key is generated, the copy to clipboard command is: $ cat ~/.ssh/id_rsa.pub | clip
but highlighting the text and right click copy will also work.
The next step is to paste the key in GitLab:
Cloning the repository to local
I proceed to create a local directory that will store my webpage information, then, on the new folder did a right click / menu / open Git Bash here.
the clonning command: $ git clone git@gitlab.fabcloud.org:academany/fabacademy/2020/labs/esan/students/luis-rodriguez.git
Notice a first failed attemp to do a pull of the repository prior to clonning with $ git pull origin master
command.
Creating my Fab Academy Website
At first, I thought that we’ll be creating our websites from scratch, turns out that GitLab was already hosting a website template in MKdocs, all I needed to do was edit the index.md
directory and voila! my first website was available in the Fab Academy 2020 students directory.
I proceed to directly edit the week01.md
file on the GitLab web, adding image files to the directory and linking them using the MarkDown syntax.
I was able to upload images directly on the GitLab folders and referencing them with: ![](../images/week01/"name of image".JPG)
this works for .gif format also, so it is a good alternative to embeeded video while maintaining the mb count low. I used this in my Home page
Another advantage of online-editing the website in GitLab is that it has a preview tab to see the changes without hitting the commit changes button. this online editor also has a very helpful buttons to get used to the MarkDown syntax highlighted here:
The feature I like the most about MarkDown syntax is the use of # for hierarchy, more # before a text line means lower level index. I discover that typing three dash lines - cause a break line like this:
As I continuing to edit and hit the commit button several times, I realized that this was not the intended way to do it, as I remembered the assignment was to work on the local versión and later push the files from the local machine to GitLab.
To synchronize my local files I opened Gitbash from my local directory and typed the $ git pull
command. I realized that I didn’t have a program to open MarkDown files, but because it is a plain text format I tried to open it with windows notepad. It worked.
As I kind of get used to the MarkDown syntax by now, I started editing this very page on the notepad using a MarkDown cheatsheet as guide.
Later, I pushed the changes up to GitLab with the commands:
git status
git add .
git commit -m "<commit message>"
git push
Notice how I forgot to edit the commit message part out of pure excitement.
These commands works like this:
git status to see what changed in the repository
git add to upload all the files at once
git commit -m “here goes the tittle so you remember what changed” stage and commits files in one go
git push upload the repository
To see more commands in GIT check this cheatshet
Final notes
Although MarkDown is very intuitive and easy to use for setting up the first week of my website, I find it limiting in the aesthetics and customization. I’ll probably be changing to an HTML version in the weeks to come.
Useful links
Did you know?
That GIT is also the name of an awesome latinamerican band?