Interview questions and answers on Git?
- User
Interview questions and answers on Git?
- Assistant
Q: What is Git? A: Git is a distributed version control system used for tracking changes in source code during software development.
Q: What is the difference between Git and SVN? A: SVN is a centralized version control system that stores files and changes on a single server, while Git is a distributed version control system that allows for the creation of multiple local repositories, making collaboration easier.
Q: How do you create a new branch in Git? A: To create a new branch in Git, use the command "git branch new_branch_name".
Q: What is a commit in Git? A: A commit in Git is the process of saving changes made to the repository.
Q: How do you revert a commit in Git? A: To revert a commit in Git, use the command "git revert commit_hash".
Q: What is a merge conflict in Git? A: A merge conflict in Git occurs when there are conflicting changes in two different branches that cannot be automatically merged.
Q: How do you resolve a merge conflict in Git? A: To resolve a merge conflict in Git, you must manually edit the conflicting files and then commit the changes.