Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion 01_version_control/my_favorite_neat_little_git_trick_demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- Preparation should not take longer than 15 mins, should be a demo.
- Lecturers also prepare some.

## Tricks from Winter Team 2025/26
## Tricks from Winter Term 2025/26

- Click on line number on GitHub and then `blame` to study history of file
- GitHub uses [gitignore templates](https://github.com/github/gitignore) if you create a `.gitignore` file from GitHub
Expand All @@ -18,6 +18,9 @@
- If you rebased/merged and messed up your history, use `git reflog` to go back to a previous state
- If you only need one file from another commit or branch, use `git checkout <branch_or_sha> -- <path>`
- Use [Git LFS](https://git-lfs.com/) for big files >10 MB or for non-diffable binaries (e.g., images, media, archives, shared libraries).
- Use `git switch -c <branch-name>` to create a new branch and immediately check it out!
- Don't get stuck thinking that branches are only used as feature branches or issue branches! You can always create a short-lived temporary branch for something small, like shelving an experimental change.
- If a temporary branch is still too much overhead for you, you can instantly stash your local changes with `git stash`. Restore your stashed changes later with `git stash pop`.

## Tricks from Winter Term 2024/25

Expand Down