Tag Archives: git quick introduction

git quick introduction

Git is distributed version control system, based on the concept of file system.

git init – Init of the new repository at the current directory.

git add <files> – Adds the files to the index/staging area.

git checkout — <file> – Removes the file from the index/staging area

git commit – Commits the change to repository.

git diff – diff report of the files between current working file and staging file / committed file.

git log – report of all the changes to the repository.

git reset HEAD <file> – Remove the file from index.

git remote -v – Working with the remote repository. Lists all the remote repositories.

git remote add origin – Adds the remote repository as origin.

git push -u origin – Push the changes to the remote repository.

git branch <branch-name> Create an branch

git checkout <branch-name> Switch to the branch

git merge <branch-name> merge the branch with the master