- What is Git?
Git is open source Distributed Version Control System which enables user to track code history including what & when changes done and who commit the changes.
This is developed by Linus Torvalds. With the help Git multiple people can work on the same file and resolve differences later.
- How Git works? Architecture of Git
Git allows developer to have code in there local machine and then they can Add & Commit their code in repo. And then that code is accessible to all other developers also.
- Explain why git is Distributed?
Git allows multiple developers to work on same project and helps in tracking the changes of code.
- Explain git workflow with image.
Below is the workflow of git:
User can create(
git init repo_name) or use a repository on which he/she wants to work and then they can write code on their local machine.
When all the updations are done then
git add filename.excan add all changes and additions in staging area.
Then whole code needs to be commit in local repository
git commit -m "any_meesage"
Now that code will be updated in remote repository so that it could be accessible to all other people who are working in same repository.
git push branch_name
-List of Top 10 Git Commands.
git init- Create repository
git add- Add file in staging area
git commit- Commit in local repository
git push- Move local branch to remote
git pull- Pull all updated code from remote repo
git status- Displays the state of the working directory
git config- Set configuration in git
git log- Shows previous revisions of a project
git clone- Creates a copy of an existing Git repository. 10.
git checkout- Checks out old commits and old file revisions