git beyond pull & push - Jørgen Kvalsvik - NDC TechTown 2023

Explore advanced Git techniques to optimize your workflow, from efficient patch application to fixing regressed problems and rewriting history, and learn how to write clear and concise commit messages.

Key takeaways
  • To get the most out of Git, focus on the commit instead of the merge or PR.
  • Use fixup and rebase to apply patches in an efficient and concise way.
  • Write a clear and concise log message that focuses on the outcome and result, rather than the changes made.
  • Use git bisect to identify and fix regressed problems.
  • Run rebase -i to write a log message that can be reviewed and adjusted before committing.
  • Cherry-pick commits from another branch using git cherry-pick or git apply.
  • Use git add -p to stage specific changes and avoid committing unwanted changes.
  • When git commit, use fixup to update the commit message and apply changes from a previous commit.
  • Focus on the why behind your commits instead of just describing the what.
  • Avoid using git merge without understanding the commits involved.
  • Always check the index before committing by running git diff.
  • Use git log to examine the commit history and identify relationships between commits.
  • Write a good log message that describes the result and outcome of your changes.
  • Use git add -p to stage specific changes and avoid committing unwanted changes.
  • Understand the distinction between merge and rebase.
  • Use git bisect to identify and fix regressed problems.
  • git is a database that can answer questions about the commit history.
  • Use git log --graph to visualize the commit history.
  • Avoid using fire without a clear justification.
  • Use git rebase -i to rewrite history and correct mistakes.
  • Use git bisect to identify and fix regressed problems.
  • Write a good log message that describes the result and outcome of your changes.