Objective. Students will initialize a Git repository, commit all course scripts with descriptive messages and a README, manage branches for script versions, and demonstrate a pull-request-style review workflow appropriate for a professional DBA team.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
Database automation scripts are production assets. A backup script that runs every night, a maintenance job that rebuilds indexes, or a monitoring alert that pages on-call staff—all of these carry real risk if they change without a record. Git gives your team a complete, auditable history of every change: who made it, when, and why. For a DBA, that audit trail is as important as the scripts themselves.
This lesson ties together all the Bash scripts you wrote in Lessons 1–7 and organizes them into a professional repository that you could hand to a new team member or present to an employer on day one.
Begin on your Linux VM. Navigate to the directory that holds your course scripts and run:
```bash
git init dba-automation
cd dba-automation
```
Copy all five core scripts into this directory. Then stage and commit them together:
```bash
git add .
git commit -m "chore: initial commit of all course DBA scripts"
```
Next, create a remote repository on GitHub or GitLab (a free personal account is sufficient). Link it and push:
```bash
git remote add origin https://github.com/yourname/dba-automation.git
git push -u origin main
```
Never commit credentials—database passwords, connection strings, or API keys—to any Git repository. Use environment variables or a secrets manager instead. Accidentally pushing a password to a public repo is a security incident, not just a mistake.
Your README.md is the front door of the repository. Every script must have its own section containing:
A missing or vague README forces teammates to read every line of code before they can safely use or modify a script. Treat the README as documentation that must be updated whenever the script changes.
Direct commits to `main` are discouraged on professional teams because they bypass review. Instead, create a feature or hotfix branch, make your changes, and open a pull request (PR) for a teammate to approve before merging.
For this lesson you will practice the hotfix workflow:
```bash
git checkout -b hotfix/backup-retention
```
Open your backup script and change `RETENTION_DAYS` from its current default to 30. Stage and commit using the Conventional Commits format:
```bash
git add backup.sh
git commit -m "fix(backup): increase default retention to 30 days"
```
Push the branch and open a pull request on GitHub or GitLab. Write a PR description that explains why the retention period is changing—not just what changed. A reviewer reading only the description should understand the business reason.
After the instructor or a classmate approves, merge and delete the branch:
```bash
git checkout main
git merge --no-ff hotfix/backup-retention
git push origin main
git branch -d hotfix/backup-retention
```
The `--no-ff` flag preserves the branch history in the graph so the merge is visible.
Conventional Commits (conventionalcommits.org) is a lightweight specification for commit messages that makes automated changelogs and semantic versioning possible. The structure is:
```
<type>(<scope>): <short description>
```
Common types: `feat` (new feature), `fix` (bug fix), `chore` (maintenance, no behavior change), `docs` (documentation only), `refactor` (code restructure without behavior change). The scope in parentheses is optional but recommended for DBA repos—use the script name or subsystem (`backup`, `monitor`, `index`).
A CHANGELOG.md records what changed, when, and in which version or date. Use reverse-chronological order (newest entry at the top). Each entry should include a date, a brief description, and which script was affected. Even a simple, human-readable CHANGELOG signals professional discipline and is required by many enterprise change-management processes.
Technical skill alone does not make a DBA effective on a team. In the five-minute hand-off role-play, you will walk a classmate through the repo as if they are joining the team tonight for an on-call shift. Show them: where each script lives, how to read the README, how to check recent commits with `git log --oneline`, and how to open a PR if they need to make an emergency change. Clear verbal communication under time pressure is a real job skill.
Git repositories that contain database scripts often become targets for credential harvesting. Apply the principle of least privilege to your remote repo: keep it private until your instructor explicitly requires a public link, revoke access for anyone who leaves the project, and add a `.gitignore` that excludes any files that might accidentally capture passwords, such as `.env` files or `*.log` files containing query output. These habits protect both your employer and any database users whose data the scripts touch.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.