Skip to content

Commit 07b60ee

Browse files
committed
Add git tricks: mini branches and stashing
1 parent ba24937 commit 07b60ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

01_version_control/my_favorite_neat_little_git_trick_demo.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Preparation should not take longer than 15 mins, should be a demo.
55
- Lecturers also prepare some.
66

7-
## Tricks from Winter Team 2025/26
7+
## Tricks from Winter Term 2025/26
88

99
- Click on line number on GitHub and then `blame` to study history of file
1010
- GitHub uses [gitignore templates](https://github.com/github/gitignore) if you create a `.gitignore` file from GitHub
@@ -18,6 +18,9 @@
1818
- If you rebased/merged and messed up your history, use `git reflog` to go back to a previous state
1919
- If you only need one file from another commit or branch, use `git checkout <branch_or_sha> -- <path>`
2020
- Use [Git LFS](https://git-lfs.com/) for big files >10 MB or for non-diffable binaries (e.g., images, media, archives, shared libraries).
21+
- Use `git switch -c <branch-name>` to create a new branch and immediately check it out!
22+
- 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.
23+
- 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`.
2124
2225
## Tricks from Winter Term 2024/25
2326

0 commit comments

Comments
 (0)