Q1: What is Git?
Ans: Git is a free and open-source version control system, used to track changes in the source code. It is used to handle small to very large projects efficiently.
Q2: How git works? Architecture of git?
Ans: Git allows users to track code changes and manage their project using simple commands.
Git stores projects in repositories. Commits are made to the project for finalising the code. New code/changes are committed on branches. Most of the work is committed on other branches and then merged with the master branch. All this is stored in the same directory as the project but in a sub-folder called ".git".
To share the code you push the changes to the repository and to get the new code, you pull changes from the repository.
Architecture of Git:
Q3: Explain Why Git is Distributed?
Ans: Git is a Distributed System because under this everyone can have there local repositories which can be accessed without any network. Everyone gets an entire copy of the repository history when they clone a repository. Any changes users make to a repository are local to their repository until they are explicitly shared.
Q4: Explain Git Workflow with image.
Ans: Git offers a lot of flexibility in how users manage changes.
Git Work Flow:
- Initialize the central repository
- Hosted central repositories
- Clone the central repository
- Make changes and commit
- Push new commits to central repository
- Managing conflicts
Q5: List of Top 10 Git commands.
Ans: Top 10 Git Commands:
- git init
- git clone
- git branch
- git checkout
- git add
- git commit
- git push
- git pull
- git merge
- git status