Q1.What is Git?
Ans.Git is the most commonly used version control system. Git tracks the changes you make to files, so you have a record of what has been done, and you can revert to specific versions should you ever need to. Git also makes collaboration easier, allowing changes by multiple people to all be merged into one source.
Q2.How git works? Architecture of git.
Ans.Git allows users to track code changes and manage their project using simple commands.The heart of Git is a repository used to contain a project. A repository can be stored locally or on a website, such as GitHub. Git allows users to store several different repositories and track each one independently.
Q3.Explain Why Git is Distributed?
Ans.Git is a free, open source distributed version control system tool designed to handle everything from small to very large projects with speed and efficiency. It was created by Linus Torvalds in 2005 to develop Linux Kernel. Git has the functionality, performance, security and flexibility that most teams and individual developers need.
Q4.Explain Git Workflow with image?
Q5.List of Top 10 Git commands?
Ans.1.git init- The git init command lets us create a new Git repository. This is the first command to start a new project in a GitHub repository.
2.git clone- git clone creates a local working copy of the source code from a remote repository.
3.git branch- git branch lets us add a new branch to an existing branch, view all existing branches, and delete a branch.
4.git checkout- The git checkout command allows us to switch to an existing branch or create and switch to a new branch
5.git add- The git adds command adds your changes in a file to the staging area where you can compare your local version and the version on the remote repository.
6.git commit- git commit saves the changes in your local repository.
7.git push- The git push command pushes the committed file changes from the local repository to the remote repository.
8.git pull- git pull fetches the last uploaded changes from the remote server into the local repository so that you can have the latest updates from your teammates.
9.git merge- The git merge command merges your branch with the parent branch.
10.git status- git status provides an overview of the current status of your repository.