Abdu Taviq

Git Version Control

YouTube Video

Just Enough git tutorial youtube thumbnail
Just Enough git tutorial youtube thumbnail

Commands

Collaboration

Pull Request

We need merge to master locally but rather we push the branch and create a Pull Request/Merge Request.

Other developers will review your changes and add comments.

When all is resolved and approved, you can merge your changes.

Merge Conflicts

Merge conflicts happen when git can’t merge two branches. It’s always 99% to happen if a file is changed on the same line in two different branches, that’s when git can’t decide how to merge.

To resolve it, it has to be done manually and you will need to check the git log to find the developer responsible for the conflict and align with them.

Branching Strategies

Single Branch

Create a single main branch and push all your commits there.

Good for personal projects.

Feature Branching

We have a single branch and each time there is a feature/bug, we create a new branch, do the changes and then merge back to main branch.

Git Flow

We have two branches develop and main.

When creating a feature/bugfix, we create a feature branch from develop. Changes are merged back to develop.

When creating a hotfix, we create a feature branch from main. Changes are tagged with a version and only merged back to develop (if needed).

We can only merge develop into master and we need to tag the commit with a release version.

Gitflow Workflow from Atlassian