Branches and merging
A branch is a parallel line of history; the main code (main) stays untouched while work happens separately.
git switch -c qa/login-tests— create and switch to a new branchgit switch main— move between branchesgit merge qa/login-tests— merge a branch into the current one
A merge conflict arises when two branches change the same lines differently. Git inserts conflict markers (<<<<<<<, =======, >>>>>>>); you pick/combine the right version, then git add + commit.
The typical team flow: branch off main → work → push → Pull Request → review → merge.
Don't fear conflicts — they're a normal work event, not an error. Rules: refresh your branch from main often (git pull origin main then merge/rebase), resolve unfamiliar code together with its author, and run the tests after resolving.
📚 Sources and documentation
- Pro Git: Basic branching and mergingofficialgit-scm.com
- git-mergeofficialgit-scm.com