Home

Search IconIcon to open search

Git recipes and how-to's

# Clone repos without pulling all the history

1
git clone url://to/source/repository --recursive --shallow-submodules --depth 1

# Squash two last commits

1
git rebase --interactive HEAD~2

And then instead of pick do either fixup or squash.

# Undo changes

For unstaged files:

1
2
git restore .
git restore path/to/file

To look into later

See also Git resources.