Bandit Level 32
Bandit Level 32 — push a commit to a Git remote and defeat a .gitignore rule that stops your file from being added.
Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.
Level Goal
There is a git repository at ssh://bandit31-git@bandit.labs.overthewire.org/home/bandit31-git/repo via the port 2220. The password for the user bandit31-git is the same as for the user bandit31.
From your local machine (not the OverTheWire machine!), clone the repository and find the password for the next level. This needs git installed locally on your machine.
Commands you may need to solve this level
git
Helpful Reading Material
Study guide
Level map: using the password for bandit31, find the password for bandit32.
What this level teaches
Pushing to a remote, and how ignore rules and server-side hooks work.
Key ideas
- The three areas. Working tree, staging area (
git add) and repository (git commit) are separate;git pushthen sends commits to the remote. .gitignore. A list of patterns Git deliberately skips. If a file you need to add matches a pattern, Git silently refuses unless you force it.- Server hooks. A remote can run a script when it receives a push and send messages back to you. Read the output of
git pushcarefully. - Read the README. It states exactly what the remote expects.
How to approach it
- Clone, then read the README to learn what file and content the server wants.
- Create it, try to add and commit it, and diagnose why Git skips it.
- Push and read what the server prints back.
Why it matters
Hooks drive continuous integration, deployments and policy checks, and understanding what git add actually does stops “my change disappeared” confusion.