aboutsummaryrefslogtreecommitdiff
path: root/git
blob: 35c7184d98d2e682b0f14e1577dbd533eb2b0043 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
syntax: bash
tags: [ vcs ]
---

# Show contents of a file
git show revision:path/to/file

# Recover a file
git restore --source=<commit or branch> path/to/file

# Find which branches contain a specific commit
git branch --contains <commit hash>

# Run commands in all existing commit
git filter-branch --tree-filter 'shell command' HEAD

# Show branches and their commits
git show-branch

# export to zip
git archive --format=zip --output path/to/file <object>