Git Flashcards
What is Git?
Git is a distributed version control system used to track changes in source code during software development.
True or False: Git is a centralized version control system.
False
What command is used to create a new Git repository?
git init
Fill in the blank: The command to stage changes in Git is _____.
git add
What command is used to commit changes in Git?
git commit
What is the purpose of the .gitignore file?
To specify files and directories that Git should ignore.
What command do you use to check the status of your Git repository?
git status
True or False: A branch in Git is a separate line of development.
True
What command is used to create a new branch?
git branch [branch-name]
What is the command to switch branches?
git checkout [branch-name]
What does the command ‘git merge’ do?
It combines changes from different branches into one branch.
Fill in the blank: The command to view the commit history is _____.
git log
What is a remote repository?
A remote repository is a version of your project that is hosted on the internet or another network.
What command is used to clone a remote repository?
git clone [repository-url]
True or False: You can only push changes to a remote repository if you have write access.
True
What command is used to push changes to a remote repository?
git push
What command is used to pull changes from a remote repository?
git pull
What is a commit hash?
A unique identifier for a specific commit in the Git history.
What does ‘git fetch’ do?
It retrieves updates from a remote repository without merging them.
Fill in the blank: In Git, a ‘fork’ is a copy of a repository that allows you to freely experiment without affecting the original project.
fork
What is the purpose of tags in Git?
Tags are used to mark specific points in history as important, often for release versions.
What command is used to create a tag?
git tag [tag-name]
True or False: Git allows you to revert to a previous commit.
True
What command is used to revert a commit?
git revert [commit-hash]