Your DevOps study space

Real explanations. Videos with tests. Fresh exams every time. Keep the streak alive and watch the XP stack up.

Ignoring files, tags & releases · Git Docs · StackwisePlanDevOps Ignoring files, tags & releases · Git Docs · StackwiseCodePython Ignoring files, tags & releases · Git Docs · StackwiseBuildDocker Ignoring files, tags & releases · Git Docs · StackwiseTestDevOps Ignoring files, tags & releases · Git Docs · StackwiseReleaseGit Ignoring files, tags & releases · Git Docs · StackwiseDeployKubernetes Ignoring files, tags & releases · Git Docs · StackwiseOperateLinux Ignoring files, tags & releases · Git Docs · StackwiseMonitorDevOps

Pick a topic

Eight tracks, each with docs, a cheat sheet, videos and tests.

How it works

One loop, repeated until it sticks.

Jump back in

Picked up from where you left off.

Free forever

Your DevOps journey starts with one click.

Sign in with Google or GitHub to open every chapter, video, test and challenge. Your progress is saved wherever you learn.

Ignoring files, tags & releases

Every real repository needs two things: keeping the wrong files out (build output, dependencies, secrets) and marking the commits that became releases. This chapter covers the .gitignore rules and traps, then how tags turn into versioned releases on GitHub.

.gitignore patterns

Patterns are matched relative to the folder the .gitignore is in:

PatternMatches
*.logAny .log file, in any folder
.envA file or folder named .env anywhere
build/Folders named build anywhere (trailing slash = folders only)
/buildOnly build at the top level (leading slash anchors it)
docs/*.pdfPDFs directly in top-level docs/, not docs/old/ (* never crosses a /)
**/logslogs at any depth
docs/**/*.pdfPDFs anywhere under docs/
!keep.logNegation: un-ignore what an earlier line ignored
# textA comment (\# for a name that really starts with #)
# dependencies and build output
node_modules/
.venv/
__pycache__/
dist/

# logs and OS junk
*.log
.DS_Store

# secrets: ignore every .env variant, but share the template
.env
.env.*
!.env.example
You can't un-ignore a file inside an ignored folder: with logs/, the line !logs/keep.log does nothing, because Git never looks inside. Use logs/* then !logs/keep.log.

Three places for ignore rules

  • .gitignore: committed and shared. Rules about the project.
  • .git/info/exclude: same syntax, never committed. For this clone only.
  • A global file for your machine: editor and OS files (.idea/, .vscode/, .DS_Store) that aren't the project's business.
$ git config --global core.excludesFile ~/.gitignore_global
#   (if unset, Git already reads ~/.config/git/ignore)
$ git check-ignore -v debug.log        # which rule ignores this file?
.gitignore:8:*.log	debug.log
$ git status --ignored                 # show ignored files too
$ git add -f dist/keep-me.js           # force-add one ignored file

Untracking an already committed file

.gitignore only affects untracked files. If .env or node_modules/ was committed before the rule existed, Git keeps tracking it. Remove it from the index but keep it on disk:

$ echo ".env" >> .gitignore
$ git rm --cached .env                 # stop tracking, keep the local file
$ git rm -r --cached node_modules      # -r for a folder
$ git commit -m "Stop tracking .env and node_modules"

$ git rm -r --cached . && git add .    # re-apply ALL ignore rules at once
  • When teammates pull this, Git deletes the file from their working folders. Warn them to back up their .env.
  • The file is still in every old commit. If it held a secret, rotate the secret; scrubbing history needs git filter-repo and a force-push, and the secret should still be treated as leaked.

Empty folders and .gitkeep

Git tracks files, not folders, so an empty folder can't be committed. The convention is an empty .gitkeep file inside it; the name means nothing to Git. To keep a folder but ignore its future contents (uploads/, logs/), put a .gitignore in it containing * and !.gitignore.

Lightweight vs annotated tags

  • Lightweight: just a name for a commit. git tag v1.0.0
  • Annotated: a stored object with tagger, date and message, optionally signed (-s). git tag -a v1.0.0 -m "First stable release"

Use annotated tags for releases: they record who released what and when, and git describe and --follow-tags only consider annotated tags by default.

$ git tag -a v1.2.0 -m "Release 1.2.0"          # tag the current commit
$ git tag -a v1.1.1 3955422 -m "Hotfix 1.1.1"   # tag an older commit
$ git tag -l "v1.*"                             # list matching tags
$ git show v1.2.0                               # tag details + the commit

$ git push origin v1.2.0            # push one tag (plain git push sends none)
$ git push --follow-tags            # commits + the annotated tags pointing at them
$ git push --tags                   # every local tag, lightweight included
$ git tag -d v1.2.0                 # delete locally...
$ git push origin --delete v1.2.0   # ...and on GitHub
Never move or re-use a pushed tag: other clones and CI caches keep the old one, so "v1.2.0" would mean different code for different people. Release v1.2.1 instead.

Semantic versioning

SemVer versions look like MAJOR.MINOR.PATCH:

2MAJORbreaking change4MINORnew feature.1PATCHbug fix.2.4.1 -> 2.4.2 fix 2.4.1 -> 2.5.0 feature 2.4.1 -> 3.0.0 breaksbumping one number resets the ones to its right to 0
The version number is a promise to whoever depends on you: same MAJOR means upgrading shouldn't break their code.
  • MAJOR for breaking changes (removed endpoint, renamed option): 2.4.1 → 3.0.0.
  • MINOR for new, backwards-compatible features: 2.4.1 → 2.5.0.
  • PATCH for backwards-compatible fixes: 2.4.1 → 2.4.2.

Bumping a number resets those to its right. Pre-releases like 3.0.0-rc.1 sort before 3.0.0, and 0.y.z means "anything may change". The v in v2.4.1 is a tag-name convention, not part of the version. It lets users judge upgrades from the number alone, and ranges like npm's ^2.4.1 (any 2.x from 2.4.1 up) rely on it.

git describe

$ git describe
v1.2.0-5-g3f9a1c2          # 5 commits after v1.2.0; "g" + short hash of HEAD
$ git describe --dirty
v1.2.0-5-g3f9a1c2-dirty    # ...with uncommitted changes
$ git describe --abbrev=0
v1.2.0                     # just the latest tag

Exactly on a tagged commit it prints just v1.2.0, which makes it a cheap build version stamp. With no tags it fails with "No names found, cannot describe anything"; with only lightweight tags it says "No annotated tags can describe…" (add --tags, or --always to fall back to a hash).

GitHub Releases

A release is a GitHub page built on a tag, with a title, notes and downloadable files. GitHub adds source archives automatically and can generate release notes from the pull requests merged since the last release. On the website: Releases → Draft a new release. Or with gh:

$ gh release create v1.2.0 --generate-notes
$ gh release create v1.2.0 dist/app-linux-amd64.tar.gz --title "v1.2.0" --notes-file CHANGELOG.md
$ gh release create v2.0.0-rc.1 --prerelease --generate-notes

If the tag doesn't exist yet, gh creates it from the default branch's latest commit (--verify-tag refuses instead). In CI, pushing a version tag is a common release trigger:

# .github/workflows/release.yml
name: Release
on:
  push:
    tags: ["v*.*.*"]

permissions:
  contents: write            # needed to create the release

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: gh release create "$GITHUB_REF_NAME" --generate-notes
        env:
          GH_TOKEN: ${{ github.token }}

Releasing is then: merge to main, git tag -a v1.3.0 -m "Release 1.3.0", git push origin v1.3.0, and the pipeline does the rest.

Questions

Pick an answer. Get it wrong and you can try again right away, no waiting. 10 questions per topic - pick a filter below, then use Recreate questions for a fresh set on that topic.

Fresh questions every time

Exam

A mixed test across the whole site, shuffled so you never know which topic comes next. When you submit, every mistake comes with the reason and a jump to the exact moment in the video that explains it.

30 questions 6 topics 20 minute limit Up to 70 XP
1–4 answer · ←→ move
History

Essay

0 / 200-250 words
Sample answer
History
0:00 / 0:00
Not started

on YouTube
Subscribe

Topic progress

Activity

Achievements

Settings

Your profile and your account.

Profile details

* Required. Saved in this browser until you sign in.

Letters, numbers, dots, dashes and underscores.
0 / 160

Account

Checking…

App

Install Stackwise on your phone or computer. It opens in its own window from your home screen, and the Docs and cheat sheets you've opened keep working without internet.

Only admins can see this

Dashboard

Sign-ups, activity, messages and reviews in one place.

Prove it

Certificates

Pass a topic's test and get a certificate with its own public page you can share or add to LinkedIn. Each test is 10 questions drawn at random and graded on the server; you need 8 right, you have 15 minutes, and you get one try per topic a day.

From first command to production

Linux for DevOps

A path through Linux the way DevOps engineers use it: ten stages, every command explained with its flags, examples, real output and mistakes, the combinations engineers chain together, and incidents worked through step by step. Practise everything in a safe lab folder.

Before the interview

Interview prep

Questions that come up in real DevOps interviews, with the kind of answer that lands. Say yours out loud first, then compare. Each one links to the chapter that goes deeper.

    Private to you

    My notes

    Everything you wrote down while watching and reading, in one place. Saved to your account, never shown to anyone.