Git: Fix on a Branch, Merge, and Keep the Tree Clean
EasyLFCS Prep15 minThe deploy config for the internal status site lives in a Git repository at /opt/site. The server's request timeout is too short, and the team rule is that every change goes through a branch.
Do the change the way the team works:
1. Create a branch named fix-timeout and, on it, commit a change to config.ini that sets timeout = 60.
2. Merge fix-timeout back into main, so main carries the new timeout.
3. The build/ directory holds build artifacts that must never be committed. Make Git ignore it with a .gitignore that is itself committed, and leave the working tree clean (git status shows nothing to commit). Keep build/ on disk: ignoring it is the fix, deleting it is not.
Git will ask who you are before your first commit; set your name and email for this repository. Grading reads the repository itself: branches, commits, what main contains, and what git status reports.
- Create and switch to a branch
- Stage and commit a change
- Merge a branch into main
- Ignore build output with a committed .gitignore and leave a clean working tree
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
