This week assignment is to get familiarise with Git as well as to develop a personal
webpage that introduces myself as well as pen my preliminary idea for the final project.
My final project idea is included under its own dedicated page.
Install Git Bash On Windows
Install Git Bash on Windows, Git Bash for Windows is a package
that includes git
and bash
.
Git is an open-source version control system for tracking source code changes when developing software. It keeps a commit history which allows you to revert to a stable state in case you mess up your code. Git also allows multiple developers to collaborate on the same code base (1).
Bash is a Unix command-line shell. The name is an acronym for the ‘Bourne-Again Shell’. It comes with useful Unix commands like cat, ssh, SCP, etc., which are not usually found on Windows (1).
Download the latest version of Git Bash from their official website:
Click the “Download for windows” button.
If the download doesn’t start, click on the “click here to download manually”
After the installation has finished, check the “Launch Git Bash” and click
“Finish” to launch Git Bash.
Finally, Git Bash terminal is launched and I can enter Git and Bash commands.
Setting Up My Git
Added my Git username and email using the following commands:
git -config –-global user.name “yeogausiong"
git -config -–global user.email “yeogausiong@gmail.com"
Generating my SSH key using the following command:
ssh-keygen -t rsa -C yeogausiong@gmail.com
Generated my SSH key using the following command:
ssh-keygen -t rsa -C yeogausiong@gmail.com
Then, displaying my SSH key using the following command:
cat ~/.ssh/id_rsa.pub
Added my public SSH key into the text box and click “Add Key”.
SSH keys establish a secure connection between my computer
and GitLab.
Before cloning, I had created a Local Repository using the following command:
mkdir fabacademy
Then I did a git clone of my repository using the following commands:
git clone git@gitlab.fabcloud.org:academany/fabacademy/2020/
labs/singapore/students/gausiong-yeo.git
I got my “URL” for git clone from my gitlab.fabcloud.org
Using the information I had learned in my lesson, in Git Bash
terminal I changed to my directory using the following command:
cd academy/gausiong-yeo
Using git pull
I use git pull command to update the local version of a repository
from a remote. It is one of the four commands that prompts network
interaction by Git. By default, git pull does two things. Updates the
current local working branch (currently checked out branch) and
updates the remote tracking branches for all other branches (2).
Using git pull commands: git pull
Using git add
git add command adds a change in the working directory to the staging area.
It tells Git that I want to include updates to a particular file in the next commit.
However, git add doesn't really affect the repository in any significant way,
changes are not actually recorded until I run git commit (3).
Using git add command to upload all the files at once: git add .
Using git add command to upload file by file: git add index.html
Using git commit
git commit command is used to save my changes to the local repository. Using
the "git commit" command only saves a new commit object in the local Git
repository. Exchanging commits must be performed manually and explicitly
(with the "git fetch", "git pull", and "git push" commands) (4).
Using git commit command: git commit -m “change I did”
Using git push
git push command is used to transfer or push the commit, which is made on a
local branch in my computer to a remote repository GitHub. The command
used for pushing to GitHub is given below (5).
Using git push command: git push
Webpage Design Using ATOM
For the webpage design, I am using ATOM source code editor. This is a free and
open-source text and source code editor for macOS, Linux, and Microsoft Windows
with support for plug-ins written in Node. It is embedded Git Control, developed by
GitHub. Atom is a desktop application built using web technologies.
I referred to W3Schools.com for learning HTML language for building my web pages.
HTML Language
Using HTML language for creating my web title, heading and paragraph.
Using HTML images syntax, my images are linked to web pages.
It two attributes are src - Specifies the path to the image and alt - Specifies an alternate text for the image.
Using an ordered list starts with the <ol> tag and each list item starts with
the <li> tag. The list items will be marked with numbers by default:
Using HTML links syntax
I can click on a link and jump to another document.
A link can be a text, an image or any other HTML
element. Example of hyperlinks:
<a href="https://www.w3schools.com/">Visit W3Schools.com!</a>
Citation
(1) Reference from URL on 01/07/2020: https://www.stanleyulili.com/git/how-to-install-git-bash-on-windows/
(2) Reference from URL on 01/07/2020: https://www.freecodecamp.org/news/git-pull-explained/#:~:text=git%20pull%20is%20a%20Git,branch%20(currently%20checked%20out%20branch)
(3) Reference from URL on 01/07/2020: https://www.atlassian.com/git/tutorials/saving-changes#:~:text=The%20git%20add%20command%20adds,until%20you%20run%20git%20commit%20.
(4) Reference from URL on 01/07/2020: https://www.git-tower.com/learn/git/commands/git-commit
(6) Reference from URL on 01/07/2020: https://www.w3schools.com/html/html_images.asp
(7) Reference from URL on 01/07/2020: https://www.w3schools.com/html/html_lists.asp
(8) Reference from URL on 01/07/2020: https://www.w3schools.com/html/html_links.asp