Debug School

yogita
yogita

Posted on

Git Assignment #1

- 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.

Image description

Below is the workflow of git:

  1. 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.

  2. When all the updations are done then git add filename.ex can add all changes and additions in staging area.

  3. Then whole code needs to be commit in local repository
    git commit -m "any_meesage"

  4. 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.

  1. git init - Create repository
  2. git add - Add file in staging area
  3. git commit - Commit in local repository
  4. git push - Move local branch to remote
  5. git pull - Pull all updated code from remote repo
  6. git status - Displays the state of the working directory
  7. git config - Set configuration in git
  8. git log - Shows previous revisions of a project
  9. git clone - Creates a copy of an existing Git repository. 10.git checkout - Checks out old commits and old file revisions

Top comments (0)