Situational guide to Git for new engineers - worktree

Situation: You need to work on multiple tickets but don’t want to duplicate a repository on your computer.

A common situation is that you are either working on task and need to switch to work on another branch or complete another task. Git stashes or just switching branch is possible but sometimes you just want to open another IDE and work in parallel. But you have a problem, you have a slow connection, or large repository and or lack in local storage. What to do.

Read more

Situational guide to Git for new engineers - undo commit without losing changes

Situation: You made a local commit and want to push your branch to remote but remote tells you not in sync.

There is a situation you have your local and remote branch in sync and you assume that your current change can be committed and pushed to remote. But you get a surprise, your colleague made a commit to your your branch and now your local version is 1 commit behind the remote and you already made a local commit.

Read more

Situational guide to Git for new engineers - merge conflict

Situation: You done a lot of work but need to merge some remote changes

This is a very common and often dreaded situation. Local changes are all working fine and tests pass but there are remote changes to some of the same files and you are worried things will break.

There are a number of steps to take in order to perform a merge regardless if there are conflicts or not so this post is a bit longer.

Read more