Learn git very basic concepts Tutorial and Workflow of git

This tutorial (Learn Git very basic concepts Tutorial), explains basic term of git. An introduction to git.

Understanding the workflow of Git

A git contain three major sections : A working directory, staging area and the git directory.

Diagram of simple git workflow

The working directory is where you can add, delete or edit the file. When you modify any of the file. Then, the changes are staged (indexed) in the staging area. After you commit your changes, the snapshot of the changes will be saved into the git directory.

Read more : Git Version control tutorial and advantage of git

Learn git very basic concept

Basic Terms for local repository

  1. Git init : This command initializes a new Git repository in local directory.
  2. Git clone: It is used to clone or copy of remote repository. In other words, Git clone command is used to copy of existing git directory from a remote repository.
  3. Git add : is used to add file to staging area.
  4. Git commit is used to create a snapshot of changes and save it to git directory.
  5. Git status is used to display the list of changed files together with the files that are yet to be staged or committed.

newsletters

Git terms for Remote Repository

  1. Git fetch is used to fetch all the object from remote repository that are not resided in local directory.
  2. Git pull is used to merge all the changes present in the remote repository to the local working directory.  Pulling is the automated version of git fetch
  3. Git push is used to send local commits to the master branch of the remote repository. Pushing is the opposite of fetching.

Terms for git branch

  1. Git merge is used to merge a branch into the active one.
  2. Git checkout is used to create branches and helps you to navigate between them.
  3. Git branch is used to list all the branches present in the repository.

Read more :  Advantage of git

Undoing Changes terms in Git

  1. Git checkout is used for checking out files, checking out commits, and checking out branches.
  2. Git revert is used for undoing a committed snapshot.
  3. Git rm can be used to remove files from the index and the working directory.
  4. Git reset will reset the index and the working directory to the last git commit’s state.
  5. Git clean remove the untracked file from the working directory.

If you like this tutorial then don’t forget to subscribe our newsletter. Join us on Facebook, Twitter and telegram.

You may also like...

Leave a Reply