Date: May 1, 2024

Topic: Branches in a Nutshell

Recall

What exactly is a git commit?

Latest commits point to previous commits.

What exactly is a git branch?

What is the HEAD pointer?

Notes

Commit and Tree

Commit and Tree

Untitled

<aside> 📌 SUMMARY: git commit is a pointer to a snapshot of the directory and git branch is a pointer to one of the commit.

</aside>


Date: May 1, 2024

Topic: Switching Branches

Recall

How to move the HEAD pointer?

Branch commits always create a new commit pointing back to the initial commit.

Notes

Untitled

Untitled

<aside> 📌 SUMMARY: Git branches can be switched using git checkout and can create a tree based structure of commits when working on a project.

</aside>


Date: May 7, 2024

Topic: Basic Merging

Recall

Keep in mind with which branch the changes will get merged with.

Merge conflicts occurs only on editing same part of the code on the same file.

Notes

$ git checkout master Switched to branch 'master' $ git merge iss53 Merge made by the 'recursive' strategy.

`<<<<<<< HEAD:index.html <div id="footer">contact : [email protected]</div>

<div id="footer"> please contact us at [email protected] </div>

iss53:index.html`

<aside> 📌 SUMMARY: Switch to the branch you would like to merge changes to and in case of merge conflicts, you can either accept/reject either one of the code on the branches.

</aside>


Date: May 7, 2024

Topic: Branch Name