How Git Works
- Two important concepts that make git are
- cryptographic hashes (hashing) -> SHA1
- snapshots
- Git use refs (references)
- branch points to a latest commit
- tag points to commit and never changes (until we do it explicitly)
- head should point to branch/tag (ideally), if head is pointing to a commit this is referred as DETACHED_HEAD
- remote ref
Scenarios
- To serve scenarios like what we discuss below, git has
- branch
- tag
I have a product like vscode
- In these products we release versions
I have a product which is HRMS and i give it to customers
- Customers might have specific changes
Git branch
- By default when you are working on git you are using a branch (master)
- Refer Here for branches
- To bring the changes from one branch to another we perform merge Refer Here
- Merge command
git checkout <destination-branch>
git merge <source-branch>
- Three way merge
- (Before)

-
After
-
Fastforward:
-
Exercise:
