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.
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.
Learn git very basic concept
Basic Terms for local repository
- Git init : This command initializes a new Git repository in local directory.
- 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.
- Git add : is used to add file to staging area.
- Git commit is used to create a snapshot of changes and save it to git directory.
- Git status is used to display the list of changed files together with the files that are yet to be staged or committed.
Git terms for Remote Repository
- Git fetch is used to fetch all the object from remote repository that are not resided in local directory.
- 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
- 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
- Git merge is used to merge a branch into the active one.
- Git checkout is used to create branches and helps you to navigate between them.
- Git branch is used to list all the branches present in the repository.
Read more : Advantage of git
Undoing Changes terms in Git
- Git checkout is used for checking out files, checking out commits, and checking out branches.
- Git revert is used for undoing a committed snapshot.
- Git rm can be used to remove files from the index and the working directory.
- Git reset will reset the index and the working directory to the last git commit’s state.
- Git clean remove the untracked file from the working directory.