FlashKeepers

Git and Version Control · College · College and University

Git II: Branching and Merging

Branches, checkout and switch, fast-forward and three-way merges, conflict resolution, tags and detached HEAD.

About this set

40 basic cards for College Git and Version Control. Set 2 of 4 in Git. It opens with "What is a branch in Git?" and "What command creates a new branch named 'feature'?". Study it alongside the other College sets below.

40 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What is a branch in Git?
Show answerA pointer to a specific commit, allowing parallel development.
What command creates a new branch named 'feature'?
Show answergit branch feature
What command lists all local branches?
Show answergit branch
What does 'git branch -a' show?
Show answerAll branches, both local and remote.
What is the default main branch name in modern Git repositories?
Show answermain
What command deletes a local branch?
Show answergit branch -d branch-name
What command renames the current branch to 'new-name'?
Show answergit branch -m new-name
How do you push a new local branch to the remote repository?
Show answergit push origin branch-name
What is the key difference between 'git checkout' and 'git switch'?
Show answergit switch is newer and more explicit; git checkout has dual purposes.
What does 'git switch -c branch-name' do?
Show answerCreates a new branch and switches to it in one command.
What is the modern command to switch to an existing branch?
Show answergit switch branch-name
What does 'git checkout -' do?
Show answerSwitches to the previously checked-out branch.
What is the older way to create and switch to a branch in one command?
Show answergit checkout -b branch-name
What is a fast-forward merge?
Show answerA merge where the target branch pointer moves forward to the source branch commit without creating a merge commit.
When does a fast-forward merge occur?
Show answerWhen the target branch has no new commits since the source branch was created from it.

25 more cards in the app

Study this set free