Best Practices: Git
This document is part of the Git workshop and describes best-practices as training material, reference documentation and review basis.
Target State
You should not operate Git as a dangerous command list. The useful model is state: working tree, index, commit graph, references, remotes and local recovery paths. The document connects concept, workflow, evidence and safe return paths.
Focus
- kleine Commits
- aussagekräftige Nachrichten
- lineare und nicht-lineare Historie
- Branch-Schutz
- Reviewfähigkeit
Core Terms
| Term | Meaning |
|---|---|
Repository |
Database of objects, references, configuration and working tree relationship for project history. |
Working Tree |
Checked-out files that you read, edit and compare against index and HEAD. |
Index |
Staging area between working tree and commit; it defines the next snapshot. |
Commit |
Immutable snapshot with parents, author, committer, message and tree object. |
HEAD |
Pointer to the currently checked-out commit or current branch reference. |
Branch |
Movable reference to a commit, usually under refs/heads/. |
Tag |
Reference to a specific state, lightweight or annotated and optionally signed. |
Remote |
Named connection to another repository with fetch and push URLs. |
Refspec |
Rule that defines which references are transferred or updated during fetch or push. |
Merge |
Integration of histories through a merge commit or fast-forward. |
Rebase |
Replay of a commit series onto another base; changes commit IDs. |
Reflog |
Local log of reference movements, useful for recovery. |
Hook |
Local or server-side script executed on specific Git events. |
Submodule |
Reference to another repository at a specific commit inside a superproject. |
Credential Helper |
Mechanism Git uses to ask for, cache or retrieve credentials from secure storage. |
Object Database |
Storage for blobs, trees, commits and tags, addressed by object IDs. |
Working Model
- Check context first: current branch,
HEAD, working tree, index and remote-tracking branches. - State whether you want to change files, index, commit graph, references or remotes.
- Execute the smallest matching change and record the command.
- Prove state with
git status,git diff,git log,git show,git branch -vv,git remote -vorgit reflog. - Assess whether the change is only local, visible in a shared branch or already published.
- Choose recovery commands only after that classification.
Reference Commands
# Check context and configuration
git --version
git config --list --show-origin
git status --short --branch
# Understand changes
git diff
git diff --staged
git log --oneline --graph --decorate --all
# Work safely
git add <path>
git commit -m "Describe the functional change"
git switch -c feature/<topic>
git merge --no-ff feature/<topic>
# Recovery and diagnosis
git reflog
git restore <path>
git restore --staged <path>
git merge --abort
git rebase --abort
Typical Decisions
| Decision | Useful Question | Risk of the Wrong Choice |
|---|---|---|
restore, reset or revert |
Is the target working tree, index, local history or shared history? | data loss, confusing team history or unnecessary conflicts |
| Merge or rebase | Should the original branch point remain visible? | changed commit IDs in shared branches |
| Annotated or lightweight tag | Should a release carry traceable metadata? | unclear release provenance |
| Credential helper | Where are credentials stored and how are they protected? | plaintext tokens or long-lived secrets |
| Submodule or another model | Must another repository be pinned to an exact commit? | hard-to-maintain dependencies and forgotten updates |
| Local or server-side hook | Is this convenience or enforceable governance? | false confidence without enforcement |
Operations Notes
- Git stores snapshots and references; it is not a central server service.
- Many seemingly destructive local states can be recovered with
reflogas long as garbage collection has not removed objects. git credential-storestores credentials unencrypted on disk; accept that only with deliberate risk analysis.- Rebase and history rewrite are useful locally but team-critical in shared branches.
- Repository hooks are not automatically trusted or globally enforced; server-side rules require platform support.
Scope Boundary
This document covers core Git functionality. Hosting platforms, pull requests, issues, Actions, GitLab CI or GitHub Advanced Security are mentioned only as adjacent practice.
Review Checklist for Best Practices
- 01. document context and desired state: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 02. explain index state: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 03. read the commit graph: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 04. assess diff and patch: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 05. check remote relationship: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 06. isolate conflict cause: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 07. use reflog as recovery path: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 08. name history rewrite risk: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 09. assess credential impact: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 10. describe signature or hook boundary: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 11. write down rollback or recovery path: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 12. state a team rule: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 13. document context and desired state: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 14. explain index state: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 15. read the commit graph: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 16. assess diff and patch: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 17. check remote relationship: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 18. isolate conflict cause: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 19. use reflog as recovery path: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 20. name history rewrite risk: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 21. assess credential impact: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 22. describe signature or hook boundary: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 23. write down rollback or recovery path: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 24. state a team rule: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 25. document context and desired state: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 26. explain index state: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 27. read the commit graph: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 28. assess diff and patch: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 29. check remote relationship: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 30. isolate conflict cause: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 31. use reflog as recovery path: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 32. name history rewrite risk: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 33. assess credential impact: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 34. describe signature or hook boundary: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 35. write down rollback or recovery path: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 36. state a team rule: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 37. document context and desired state: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 38. explain index state: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 39. read the commit graph: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 40. assess diff and patch: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 41. check remote relationship: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 42. isolate conflict cause: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 43. use reflog as recovery path: record which Git reference, commit, index state or remote is affected and how you prove the state.
- 44. name history rewrite risk: record which Git reference, commit, index state or remote is affected and how you prove the state.
Practice Appendix: Best Practices
This appendix provides a backlog for longer trainings, reviews and repetition. Each task is small enough to reproduce in a local lab repository.
A001. kleine Commits
- Task: document context and desired state and explicitly relate the observation to
kleine Commits. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A002. aussagekräftige Nachrichten
- Task: explain index state and explicitly relate the observation to
aussagekräftige Nachrichten. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A003. lineare und nicht-lineare Historie
- Task: read the commit graph and explicitly relate the observation to
lineare und nicht-lineare Historie. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A004. Branch-Schutz
- Task: assess diff and patch and explicitly relate the observation to
Branch-Schutz. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A005. Reviewfähigkeit
- Task: check remote relationship and explicitly relate the observation to
Reviewfähigkeit. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A006. Repository
- Task: isolate conflict cause and explicitly relate the observation to
Repository. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A007. Working Tree
- Task: use reflog as recovery path and explicitly relate the observation to
Working Tree. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A008. Index
- Task: name history rewrite risk and explicitly relate the observation to
Index. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A009. Commit
- Task: assess credential impact and explicitly relate the observation to
Commit. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A010. HEAD
- Task: describe signature or hook boundary and explicitly relate the observation to
HEAD. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A011. Branch
- Task: write down rollback or recovery path and explicitly relate the observation to
Branch. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A012. Tag
- Task: state a team rule and explicitly relate the observation to
Tag. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A013. Remote
- Task: document context and desired state and explicitly relate the observation to
Remote. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A014. Refspec
- Task: explain index state and explicitly relate the observation to
Refspec. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A015. Merge
- Task: read the commit graph and explicitly relate the observation to
Merge. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A016. Rebase
- Task: assess diff and patch and explicitly relate the observation to
Rebase. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A017. Reflog
- Task: check remote relationship and explicitly relate the observation to
Reflog. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A018. Hook
- Task: isolate conflict cause and explicitly relate the observation to
Hook. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A019. Submodule
- Task: use reflog as recovery path and explicitly relate the observation to
Submodule. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A020. Credential Helper
- Task: name history rewrite risk and explicitly relate the observation to
Credential Helper. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A021. Object Database
- Task: assess credential impact and explicitly relate the observation to
Object Database. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A022. kleine Commits
- Task: describe signature or hook boundary and explicitly relate the observation to
kleine Commits. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A023. aussagekräftige Nachrichten
- Task: write down rollback or recovery path and explicitly relate the observation to
aussagekräftige Nachrichten. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A024. lineare und nicht-lineare Historie
- Task: state a team rule and explicitly relate the observation to
lineare und nicht-lineare Historie. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A025. Branch-Schutz
- Task: document context and desired state and explicitly relate the observation to
Branch-Schutz. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A026. Reviewfähigkeit
- Task: explain index state and explicitly relate the observation to
Reviewfähigkeit. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A027. Repository
- Task: read the commit graph and explicitly relate the observation to
Repository. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A028. Working Tree
- Task: assess diff and patch and explicitly relate the observation to
Working Tree. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A029. Index
- Task: check remote relationship and explicitly relate the observation to
Index. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A030. Commit
- Task: isolate conflict cause and explicitly relate the observation to
Commit. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A031. HEAD
- Task: use reflog as recovery path and explicitly relate the observation to
HEAD. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A032. Branch
- Task: name history rewrite risk and explicitly relate the observation to
Branch. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A033. Tag
- Task: assess credential impact and explicitly relate the observation to
Tag. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A034. Remote
- Task: describe signature or hook boundary and explicitly relate the observation to
Remote. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A035. Refspec
- Task: write down rollback or recovery path and explicitly relate the observation to
Refspec. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A036. Merge
- Task: state a team rule and explicitly relate the observation to
Merge. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A037. Rebase
- Task: document context and desired state and explicitly relate the observation to
Rebase. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A038. Reflog
- Task: explain index state and explicitly relate the observation to
Reflog. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A039. Hook
- Task: read the commit graph and explicitly relate the observation to
Hook. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A040. Submodule
- Task: assess diff and patch and explicitly relate the observation to
Submodule. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A041. Credential Helper
- Task: check remote relationship and explicitly relate the observation to
Credential Helper. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A042. Object Database
- Task: isolate conflict cause and explicitly relate the observation to
Object Database. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A043. kleine Commits
- Task: use reflog as recovery path and explicitly relate the observation to
kleine Commits. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A044. aussagekräftige Nachrichten
- Task: name history rewrite risk and explicitly relate the observation to
aussagekräftige Nachrichten. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A045. lineare und nicht-lineare Historie
- Task: assess credential impact and explicitly relate the observation to
lineare und nicht-lineare Historie. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A046. Branch-Schutz
- Task: describe signature or hook boundary and explicitly relate the observation to
Branch-Schutz. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A047. Reviewfähigkeit
- Task: write down rollback or recovery path and explicitly relate the observation to
Reviewfähigkeit. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A048. Repository
- Task: state a team rule and explicitly relate the observation to
Repository. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A049. Working Tree
- Task: document context and desired state and explicitly relate the observation to
Working Tree. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A050. Index
- Task: explain index state and explicitly relate the observation to
Index. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A051. Commit
- Task: read the commit graph and explicitly relate the observation to
Commit. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A052. HEAD
- Task: assess diff and patch and explicitly relate the observation to
HEAD. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A053. Branch
- Task: check remote relationship and explicitly relate the observation to
Branch. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A054. Tag
- Task: isolate conflict cause and explicitly relate the observation to
Tag. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A055. Remote
- Task: use reflog as recovery path and explicitly relate the observation to
Remote. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A056. Refspec
- Task: name history rewrite risk and explicitly relate the observation to
Refspec. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A057. Merge
- Task: assess credential impact and explicitly relate the observation to
Merge. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A058. Rebase
- Task: describe signature or hook boundary and explicitly relate the observation to
Rebase. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A059. Reflog
- Task: write down rollback or recovery path and explicitly relate the observation to
Reflog. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A060. Hook
- Task: state a team rule and explicitly relate the observation to
Hook. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A061. Submodule
- Task: document context and desired state and explicitly relate the observation to
Submodule. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A062. Credential Helper
- Task: explain index state and explicitly relate the observation to
Credential Helper. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A063. Object Database
- Task: read the commit graph and explicitly relate the observation to
Object Database. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A064. kleine Commits
- Task: assess diff and patch and explicitly relate the observation to
kleine Commits. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A065. aussagekräftige Nachrichten
- Task: check remote relationship and explicitly relate the observation to
aussagekräftige Nachrichten. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A066. lineare und nicht-lineare Historie
- Task: isolate conflict cause and explicitly relate the observation to
lineare und nicht-lineare Historie. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A067. Branch-Schutz
- Task: use reflog as recovery path and explicitly relate the observation to
Branch-Schutz. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A068. Reviewfähigkeit
- Task: name history rewrite risk and explicitly relate the observation to
Reviewfähigkeit. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A069. Repository
- Task: assess credential impact and explicitly relate the observation to
Repository. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A070. Working Tree
- Task: describe signature or hook boundary and explicitly relate the observation to
Working Tree. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A071. Index
- Task: write down rollback or recovery path and explicitly relate the observation to
Index. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A072. Commit
- Task: state a team rule and explicitly relate the observation to
Commit. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A073. HEAD
- Task: document context and desired state and explicitly relate the observation to
HEAD. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A074. Branch
- Task: explain index state and explicitly relate the observation to
Branch. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A075. Tag
- Task: read the commit graph and explicitly relate the observation to
Tag. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A076. Remote
- Task: assess diff and patch and explicitly relate the observation to
Remote. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A077. Refspec
- Task: check remote relationship and explicitly relate the observation to
Refspec. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A078. Merge
- Task: isolate conflict cause and explicitly relate the observation to
Merge. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A079. Rebase
- Task: use reflog as recovery path and explicitly relate the observation to
Rebase. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A080. Reflog
- Task: name history rewrite risk and explicitly relate the observation to
Reflog. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A081. Hook
- Task: assess credential impact and explicitly relate the observation to
Hook. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A082. Submodule
- Task: describe signature or hook boundary and explicitly relate the observation to
Submodule. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A083. Credential Helper
- Task: write down rollback or recovery path and explicitly relate the observation to
Credential Helper. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A084. Object Database
- Task: state a team rule and explicitly relate the observation to
Object Database. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A085. kleine Commits
- Task: document context and desired state and explicitly relate the observation to
kleine Commits. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A086. aussagekräftige Nachrichten
- Task: explain index state and explicitly relate the observation to
aussagekräftige Nachrichten. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A087. lineare und nicht-lineare Historie
- Task: read the commit graph and explicitly relate the observation to
lineare und nicht-lineare Historie. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
A088. Branch-Schutz
- Task: assess diff and patch and explicitly relate the observation to
Branch-Schutz. - Evidence: Write down at least one Git command, one expected result and one limit of that evidence.
- Team question: What coordination is required before this change lands in a shared branch?
- Security question: Which credentials, signatures, hooks or confidential files could be affected?
- Recovery: Explain whether
reflog,restore,reset,revert,merge --abort,rebase --abortor a backup is the right path.
Official Sources and Scope
The material is aligned with public Git documentation. GitHub, GitLab, Forgejo and other hosting platforms are mentioned only where they explain common Git workflows; they are not the same thing as Git itself.
- Git Reference: https://git-scm.com/docs
- Git Manual: https://git-scm.com/docs/git
- Pro Git Book: https://git-scm.com/book/en/v2
- git-submodule: https://git-scm.com/docs/git-submodule
- gitcredentials: https://git-scm.com/docs/gitcredentials
- git-credential-store: https://git-scm.com/docs/git-credential-store
- GitHub Certifications: https://docs.github.com/en/get-started/showcase-your-expertise-with-github-certifications/about-github-certifications
- GitHub Foundations on Microsoft Learn: https://learn.microsoft.com/en-us/credentials/certifications/github-foundations/
Additional Review Drills
Use these drills when the primary task is complete and the learner needs another pass over operational reasoning. They are intentionally evidence-oriented and can be answered in a local lab repository.
Drill 01: working tree
- State which Git state or reference is affected by
working tree. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 02: index
- State which Git state or reference is affected by
index. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 03: commit graph
- State which Git state or reference is affected by
commit graph. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 04: branch reference
- State which Git state or reference is affected by
branch reference. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 05: remote-tracking branch
- State which Git state or reference is affected by
remote-tracking branch. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 06: reflog
- State which Git state or reference is affected by
reflog. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 07: credential helper
- State which Git state or reference is affected by
credential helper. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 08: signature
- State which Git state or reference is affected by
signature. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 09: hook
- State which Git state or reference is affected by
hook. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 10: submodule
- State which Git state or reference is affected by
submodule. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 11: tag
- State which Git state or reference is affected by
tag. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 12: recovery
- State which Git state or reference is affected by
recovery. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 13: working tree
- State which Git state or reference is affected by
working tree. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 14: index
- State which Git state or reference is affected by
index. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 15: commit graph
- State which Git state or reference is affected by
commit graph. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.
Drill 16: branch reference
- State which Git state or reference is affected by
branch reference. - Name one command that produces evidence and one field or line in the output that matters.
- Explain what can be concluded from that evidence and what cannot be concluded from it.
- Describe the safest recovery path for a shared training repository.