https://sourcelevel.io/blog/7-git-best-practices-to-start-using-in-your-next-commit
- Rebase your working branch frequently. It’s crucial always to keep your branch rebase with the latest code. Writing new code upon obsolete one is useless. It is as meaningless as fixing a bug that may already be fixed. You should rebase your working branch frequently to prevent bugs, rework, and the tedious job of resolving conflicts with the upstream branch. You can do it easily by running these commands:
git checkout <upstream_branch>
git pull
git checkout -
git rebase <upstream_branch>
A cool trick is using
git fetch --prune
. It doesn’t require you to checkout to the upstream branch to update it. I love it.
Use the tool.
git cherry-pick
git diff and git apply
git stash
git bisect