0
0
Gitdevops~5 mins

What a branch is (pointer to a commit) in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a branch in Git?
A branch in Git is a pointer to a specific commit. It helps you keep track of different lines of work in your project.
Click to reveal answer
beginner
How does a branch pointer work in Git?
A branch pointer moves forward automatically when you make new commits, always pointing to the latest commit on that branch.
Click to reveal answer
beginner
Why use branches in Git?
Branches let you work on new features or fixes separately without changing the main code. This keeps work organized and safe.
Click to reveal answer
beginner
What happens when you switch branches in Git?
Switching branches changes your working files to match the commit the branch points to, letting you work on different versions easily.
Click to reveal answer
beginner
How can you see all branches in a Git repository?
Use the command git branch to list all branches and see which one you are currently on.
Click to reveal answer
What does a Git branch point to?
AA specific commit
BA file
CA folder
DA remote server
What happens to a branch pointer when you make a new commit on that branch?
AIt creates a new branch
BIt stays on the old commit
CIt deletes the old commit
DIt moves to the new commit
Which command shows all branches in your Git repository?
Agit status
Bgit commit
Cgit branch
Dgit push
Why do developers use branches in Git?
ATo work on features separately
BTo delete files
CTo speed up the computer
DTo backup the entire project
What does switching branches do to your working files?
AUploads files to the cloud
BChanges them to match the branch's commit
CDeletes all files
DCreates a new file
Explain what a branch is in Git and how it relates to commits.
Think of a branch as a label that moves along your project history.
You got /4 concepts.
    Describe why using branches is helpful when working on a project.
    Imagine working on different tasks without mixing them up.
    You got /4 concepts.