Introduction
This assignment is targeted at building my own project tracking website under the course’s general website. The basic processes are listed here:
- Learn how to use git. Because I’m using the Windows system, I will use git bash; understand how it works to control the version and what’s push/clone
- Build the connection through SSH and understand the meaning of public key/ private key involved inside, and how to use them
- Try to push the first test of the website. Then make a request for AI to generate the HTML for the website framework.
AI Statement
The steps I followed are all extracted by ChatGPT 5 by browsing original HTMAA documents. The troubleshooting of coding and questions of the underlying principle are also answered by ChatGPT. I originally used the Chinese prompt (will be posted here later), but after I understood it, I manually wrote this documentation in English to help me test my knowledge.
ChatGPT conversation link, originally Chinese promptGit
1. Check whether my computer already has git
I remembered I did it before, but it’s worth double-checking:
C:\Users\renhu>git --version
git version 2.45.0.windows.1
Yes, my computer already has git.
C:\Users\renhu>git config --global user.name "HuanyuRen"
C:\Users\renhu>git config --global user.email "hyren@mit.edu"
#can be double checked with the following command:
C:\Users\renhu>git config --list
...(omit)
user.name=HuanyuRen
user.email=hyren@mit.edu
But, when I try to do the next step following the instructions, it says:
C:\Users\renhu>ls -al ~/.ssh
'ls' is neither an internal nor an external command, nor is it a runnable program or batch file.
Ok, the problem is, “ls” is a classic Linux command, and I’m running Windows Terminal now. To solve it, we need the git bash: luckily, I also have it on my computer.
2. Understand “ls”
ls = “list”, and this Linux command displays the files and subdirectories in the current directory.
ls # Lists files in the current directory
ls -l # Detailed information (permissions, size, date)
ls -a # Displays hidden files (those starting with a dot)
ls -al # Detailed + Hidden, most commonly used
As a result, here the instruction said, use command:
renhu@LAPTOP-36NAMOTR MINGW64 ~
$ ls -al ~/.ssh
ls: cannot access '/c/Users/renhu/.ssh': No such file or directory
It’s trying to find the hidden file ~/.ssh to see whether it already exists, and it returns that it doesn’t exist. As a result, we need to create one next.
Small notification: Windows and Linux terminals don’t support Ctrl+C/V, so I need to right-click and choose paste manually
3. SSH key generation
renhu@LAPTOP-36NAMOTR MINGW64 ~
$ ssh-keygen -t ed25519 -C "hyren@mit.edu"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/renhu/.ssh/id_ed25519):
Created directory '/c/Users/renhu/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/renhu/.ssh/id_ed25519
Your public key has been saved in /c/Users/renhu/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:/lthzZDodm7gNLgxjyxYP3F04jIhjxX6HRFR4wNjdl4 hyren@mit.edu
The key's randomart image is:
+--[ED25519 256]--+
| . O++ E |
| . + O + |
| o o = B |
| * B + = |
| o S X + o |
| o + # * . |
| . . B o + |
| . o o |
| o. |
+----[SHA256]-----+
$ cat ~/.ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0Af38YWe/ZYvqPYxEQgeQRa8hv/8vOi4YnGbigngzF hyren@mit.edu
#"Cat" is the abbreviation of "concatenate", and its original meaning is "connection". In the command line, the most commonly used function is to print the contents of a file onto the screen.
Here are two steps: generate a new SSH key and then read it. Then, I need to copy it(The whole line, including the ssh-ed25519 at the beginning and the email at the end) to the GitLab in my own SSH setting.
Some important knowledge here: Is it safe to publish the key it generated in a publicly available document? How does it work, and what’s ED25519?
4. Public key and private key
What happened during SSH authentication? The server has saved the public key that you uploaded. When you attempt to connect, the server will randomly generate a “challenge question”, which will be encrypted with the public key and sent to you. Only your local private key can correctly solve the challenge. After you unseal it and send back the answer, if the server verifies it to be correct, then you will know that “it’s really you”. –From GPT
As mentioned above, “Your public key has been saved in /c/Users/renhu/.ssh/id_ed25519.pub” and then we are reading this file, so we are uploading the public key; it’s safe to publish it anywhere, so I can paste it here safely.
And ED25519 is the Git-recommended SSH key arithmetic. No need to explore deeper into cryptology, which is beyond the requirement of this task
5. Port and host key problem
renhu@LAPTOP-36NAMOTR MINGW64 ~
$ ssh -T git@gitlab.cba.mit.edu
ssh: connect to host gitlab.cba.mit.edu port 22: Connection refused
The CBA server is not using the default port 22, but a self-designed 846 port.
As a result, I need to write the ~/.ssh/config file for the default port setting:
Host gitlab.cba.mit.edu
HostName gitlab.cba.mit.edu
Port 846
User git
IdentityFile ~/.ssh/id_ed25519
Then, the first ssh connection test shows this:
renhu@LAPTOP-36NAMOTR MINGW64 ~
$ ssh -T git@gitlab.cba.mit.edu
The authenticity of host '[gitlab.cba.mit.edu]:846 ([18.27.130.25]:846)' can't be established.
ED25519 key fingerprint is SHA256:qgisa9GzBv/AeAEsYw0UNq0SW2Biv3xjacSwzzkXL5g.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
I saw some replies like “not known”, “can’t be established”. Is this correct?
YES!
The ED25519 key shown here is kind of like the public key of the server (host key), which can be used to identify the server from my side, in case there are some counterfeit CBA sites. When connecting to the new host key, there will be a notification like this that you have never seen this fingerprint before. When you enter “yes” here, the computer will remember this host key and not ask next time. If it’s a fake site and the host key has changed, the notification will show again.
Welcome to GitLab, @HuanyuRen!
Good job!
6. Git clone
renhu@LAPTOP-36NAMOTR MINGW64 ~
$ git clone ssh://git@gitlab.cba.mit.edu:846/classes/863.25/people/HuanyuRen.git
Cloning into 'HuanyuRen'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 12 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (12/12), done.
Resolving deltas: 100% (2/2), done.
renhu@LAPTOP-36NAMOTR MINGW64 ~
$ cd HuanyuRen #cd = change directory
Problem: When I cloned the files from Git, where are they in my local directory?
renhu@LAPTOP-36NAMOTR MINGW64 ~/HuanyuRen (main)
$ pwd #pwd = print working directory
/c/Users/renhu/HuanyuRen
7. Git add/commit/push
renhu@LAPTOP-36NAMOTR MINGW64 ~/HuanyuRen (main)
$ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
renhu@LAPTOP-36NAMOTR MINGW64 ~/HuanyuRen (main)
$ git add .
renhu@LAPTOP-36NAMOTR MINGW64 ~/HuanyuRen (main)
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: README.md
renhu@LAPTOP-36NAMOTR MINGW64 ~/HuanyuRen (main)
$ git commit -m "test example"
[main 90202b3] test example
1 file changed, 2 insertions(+)
renhu@LAPTOP-36NAMOTR MINGW64 ~/HuanyuRen (main)
$ git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
renhu@LAPTOP-36NAMOTR MINGW64 ~/HuanyuRen (main)
$ git push
Experiences from the recitation: Always use git status to double check before any push!
git commit: similar to the snapshot of updated version, and it can be archived in git.
5. html development
My website you see here is the result of repeating chatting and learning from Copilot on VSCode (ChatGPT 4.1). The basic framwork is generated by AI first and I fintuned it for my own style idea. The background photos are my own astrophotography works.
The Website Logo was generated by Google AI studio (nanobanana) with the prompt: I'm an astrochemist, and I want to design an icon for my personal website, which is a dark background so I need a bright-colored icon. About the icon, i want a galaxy in a beaker; the simple sytle without many details, and I only want white color thick lines.
Additionally, the original text version of these notes were wrote in markdown version with Typora; Then, I applied the open-source software Pandoc (Pandoc.org) to convert it to HTML in my designed template style(Template.html). Here is a code example to convert this page in command line:
pandoc Git.md -o Git.html --template=template.html --metadata title="Huanyu HTMAA 2025 week2-1"