0
0
Gitdevops~5 mins

Listing branches in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What command lists all local branches in a Git repository?
The command git branch lists all local branches in your Git repository.
Click to reveal answer
beginner
How do you list all remote branches in Git?
Use git branch -r to list all remote branches.
Click to reveal answer
beginner
What command shows both local and remote branches in Git?
Use git branch -a to see all branches, local and remote.
Click to reveal answer
beginner
What does the asterisk (*) mean when you run git branch?
The asterisk (*) marks the branch you are currently working on (the active branch).
Click to reveal answer
intermediate
How can you list branches sorted by the last commit date?
Use git branch --sort=-committerdate to list branches sorted by the most recent commit first.
Click to reveal answer
Which command lists only local branches in Git?
Agit branch -a
Bgit branch -r
Cgit branch
Dgit branch --all
What does git branch -r show?
ARemote branches
BLocal branches
CAll branches
DBranches with last commit date
How do you see all branches, local and remote, in one command?
Agit branch -a
Bgit branch -r
Cgit branch
Dgit branch --remote
In the output of git branch, what does the * symbol indicate?
AA remote branch
BThe current active branch
CA deleted branch
DA branch with conflicts
Which command sorts branches by the most recent commit date?
Agit branch --sort=authorname
Bgit branch --sort=committerdate
Cgit branch -r
Dgit branch --sort=-committerdate
Explain how to list local, remote, and all branches in Git.
Think about the different flags used with git branch.
You got /3 concepts.
    Describe what the asterisk (*) means in the output of git branch.
    It marks your current position in the project.
    You got /2 concepts.