Skip to content

Commit ba4e11a

Browse files
authored
Add git tricks: patch PRs with amend and force-push (#265)
1 parent 134b411 commit ba4e11a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

01_version_control/my_favorite_neat_little_git_trick_demo.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
```
3535
3636
Usage: e.g. `git add -p ...` and then `git amend HEAD~5`. This would add the staged changes to the fifth last commit.
37+
- Update an open PR without cluttering the history
38+
- `git commit --amend --no-edit`
39+
- `git push --force-with-lease origin <branch-name>`
40+
- Perfect for fixing small nits or typos from code reviews. It updates the existing commit instead of adding a messy "fix typo" log.
3741
3842
## Tricks from Winter Term 2024/25
3943

0 commit comments

Comments
 (0)