Skip to main content

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

  1. 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
    
  2. Go into your Module 3 scripts folder and initialise a repository with git init. Confirm with git status.
  3. Create a .gitignore that 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.
  4. Stage your scripts deliberately (name them with git add, inspect with git status and git diff --staged).
  5. 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 short README.md describing what the scripts do as one of those commits.
  6. In the Gitea web UI, create a new empty repository named module3-scripts (do not let Gitea add a README, so it starts empty).
  7. 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
    
  8. 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 status in the folder reports a clean working tree (nothing uncommitted).
  • git log --oneline shows at least three commits with clear, imperative-mood messages.
  • A .gitignore is committed and excludes logs, temp files, and secret/env files.
  • No passwords, tokens, or secrets appear in any tracked file.
  • A README.md describing the scripts is committed.
  • git remote -v shows origin pointing at your Gitea repo.
  • The repository and all commits are visible in the Gitea web UI under module3-scripts.
  • git push reports everything is up to date (local main matches origin/main).

Hints

  • Run git status constantly — before and after every add and commit. 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.