Roles, levels, interviews and how to grow into them.
2 items at beginner level · all topics
Your branch is 5 commits behind main and you have uncommitted changes. How do you update safely?
Save the uncommitted work first with a stash or a WIP commit, then fetch and rebase onto origin/main, then bring it back. The real point is knowing what git pull would do to your branch before you run it.
You made a commit but forgot to include one file, and it isn't pushed yet. What do you do?
Stage the file and run `git commit --amend`. Amend doesn't edit the previous commit, it replaces it with a new one that has a new SHA, which is free while the commit is still local and a problem the moment someone else has it.