git | Learn for Master
  • The most essential Git commands you must know

    git file change diagram

    Git is the most widely used modern version control system.  When you learn git, you may encounter issues to master all the git commands.  In this tutorial, we list the essential git commands. After master these commands, you can use git to accomplish most of the version control tasks. 

    The following two diagrams show how git manages your files.

    git file change diagram

    The four stages of a file in git

    git diagram

    1. Create a Repository
      Create a new local repository from scratch

      Download from an existing repository

    2. Check your repository
      List the files that have not been committed 

      Show the changes to files not staged

      Show full change history

      Show more detailed change history

      show the changes between two commits ids

    3. Git Branches
      List all local branches

      List all local and remote branches

      create a new branch

      Switch to a branch

      create a new branch using an old branch and switch to the new branch

      delete a local branch

      delete a remote branch

      tag a branch

      merge branch_a to branch_b

    4. Add files to repository and do commit
      Add a single file to index,
    [Read More...]