Assignment 1: Version your Module 3 scripts on Gitea
Goal: Take the shell scripts you wrote in Module 3, turn their folder into a real Git repository with clean commit history, and publish it to the lab's Gitea server.
Where: On your lab VM, in the folder holding your Module 3 scripts. The remote is the lab Gitea server — public URL https://git.example.com, internal http://10.100.100.2:3000.
Tasks
- If you haven't already, set your Git identity once on the VM:
git config --global user.name "Your Name" git config --global user.email "you@example.com" git config --global init.defaultBranch main - Go into your Module 3 scripts folder and initialise a repository with
git init. Confirm withgit status. - Create a
.gitignorethat excludes at least logs and any environment/secret files (e.g.*.log,*.tmp,.env). Make sure no real secrets or passwords are anywhere in the tracked files. - Stage your scripts deliberately (name them with
git add, inspect withgit statusandgit diff --staged). - Make at least three separate commits, each grouping related changes, with clear imperative-mood messages (e.g.
Add backup script,Add .gitignore,Document usage in README). Add a shortREADME.mddescribing what the scripts do as one of those commits. - In the Gitea web UI, create a new empty repository named
module3-scripts(do not let Gitea add a README, so it starts empty). - Wire up the remote and push:
git remote add origin http://10.100.100.2:3000/yourname/module3-scripts.git git remote -v git push -u origin main - Open the repo in the Gitea web UI and confirm your files, commits, and messages all appear.
Deliverable
A Gitea repository module3-scripts containing your Module 3 scripts, a README.md, and a .gitignore, with at least three meaningful commits visible in the history, pushed to origin/main.
Acceptance criteria — you're done when:
-
git statusin the folder reports a clean working tree (nothing uncommitted). -
git log --onelineshows at least three commits with clear, imperative-mood messages. - A
.gitignoreis committed and excludes logs, temp files, and secret/env files. - No passwords, tokens, or secrets appear in any tracked file.
- A
README.mddescribing the scripts is committed. -
git remote -vshowsoriginpointing at your Gitea repo. - The repository and all commits are visible in the Gitea web UI under
module3-scripts. -
git pushreports everything is up to date (localmainmatchesorigin/main).
Hints
- Run
git statusconstantly — before and after everyaddandcommit. It is your map. - To split work into multiple commits, stage and commit one logical group at a time instead of
git add .then one big commit. - Gitea asks for credentials on push. Prefer a personal access token (Gitea → Settings → Applications) over your password; never paste a real token anywhere shared — treat it as
<REDACTED>. - If your first push is rejected, re-read Lesson 4 section 3, and confirm the remote repo you created was empty.
- Forgot to ignore a file you already committed?
git rm --cached <file>untracks it while leaving it on disk, then commit. - Blocked for >~30 min after re-reading the lessons? Bring what you've tried to your mentor.
No comments to display
No comments to display