Git ≠ Github

·

2 min read

Git ≠ Github

Git and Github is connected in some way but not like the superficial connection of Java and Javascript.

GIT :

Git is an extremely popular version control system that is at the heart of a wide variety of high-profile projects. Git is installed and maintained on our local system.

Stages of Git Workflow

8454OS_01_4.webp

  • Modified means that you have changed the file but have not committed it to your database yet.

  • Staged means that you have marked a modified file in its current version to go into your next commit snapshot.

  • Committed means that the data is safely stored in your local database.

GITHUB

GitHub is to Git what Facebook is to your actual face. What’s that mean? Well, it means that instead of pictures, you have code. GitHub is designed as a Git repository hosting service.

BASIC GIT COMMANDs

  • git config : This command sets the author name and email address respectively to be used with your commits.
    $ git config –global user.name “[name]”
    $ git config –global user.email “[email address]”
    
  • git init : This command is used to start a new repository.
    $ git init
    
  • git clone : This command is used to obtain a repository from an existing URL.
    $ git clone [url]
    
  • git add : This command adds a file to the staging area.
    $ git add [file]
    
  • git add . : This command adds every file to the staging area.
    $ git add .
    
  • git commit : This command records or snapshots the file permanently in the version history.
    $ git commit -m “[ Type in the commit message]”
    
  • git status : This command lists all the files that have to be committed.
    $ git status
    
  • git log : This command is used to list the version history for the current branch.
    $ git log
    
  • git branch : This command creates a new branch.
    $ git branch [branch name]
    
  • git push : This command sends the committed changes of master branch to your remote repository.
    $ git push [variable name] master