Git Flashcards
What is Git?
Git is a distributed version control system designed to handle projects of all sizes efficiently.
How does Git differ from SVN?
Git is distributed, every dev’s copy is a full-fledged repository, unlike SVN’s single repository approach.
What is a ‘commit’ in Git?
A commit in Git is a snapshot of your repository’s history at a specific point, containing changes and a message.
Explain ‘branching’ in Git.
Branching lets developers diverge from the main code base for new features or fixes without affecting the main line.
What is a ‘merge’ in Git?
Merging is integrating changes from one branch into another in Git.
Define ‘rebase’ in Git.
Rebase is a method of moving a series of commits to a new base commit.
What is a ‘pull request’?
A pull request is a method of submitting contributions to a project, requesting the maintainer to pull your changes.
Describe ‘forking’ a repo.
Forking a repo involves making a personal copy of someone else’s project to work on it separately.
What is a ‘conflict’ in Git?
A conflict arises in Git when two branches have edits in the same line or one branch deleted a file that another modified.
How do you resolve a merge conflict in Git?
To resolve a merge conflict in Git, manually edit the files, then mark them as resolved and complete the merge.
Explain the concept of ‘blame’ in Git.
git blame
shows who last modified each line of a file.
What is a ‘bare’ repository in Git?
A bare repository in Git is a repository that does not contain a working directory.
How do you rename a local Git branch?
Use git branch -m
to rename a branch.
What does git push
do?
git push
uploads local repository content to a remote repository.
Explain ‘fast-forward’ merge in Git.
A fast-forward merge is where the target branch’s tip is advanced to the source branch’s tip.