GIT Version:

git --version

Set name credential:

git config --global "uname"

Set E-mail credential:

git config — global ""

See all configurations:

git config —-list

See own custom configurations:

git config --list --global

Help Command ``` git help ``` Get help from a specific command

git help commit

Create a Repository

git init

Delete a Repository :

rm -rf .git

Add a file

git add index.html

Add multiple files

git add index.html index.js

Add all files

git add .

Add all the files in the current directory by their extension:

git add *.txt

Add all the files that are in a folder:

git add css/

Add all the files that were modified:

git add -u

Add all the files by their extension that are inside a folder:

git add pdfs/*.pdf

See modified files

git status

See the modified files without so much information:

git status -s

See the modified files and in which branch we are working:

git status -sb

Delete a file that was in the staging area

git reset index.js

Delete a file that was in the staging area by their extension

git reset *.xml

Commit Changes

git commit -m 'navbar created'

See all the commits that we did

git log

See all the commits that we did in a pretty way

git log --oneline --decorate --all --graph

Create a Aliase/Shortcut

git config --global alias.lg "log --oneline --decorate --all --graph"

*So now we can do: `git lg` for the pretty log command*

Review of the basic and important commands

  • `$ git init` Initialize a local Git Repository
  • `$ git add ` Add file to the Staging Area
  • `$ git status` Check status of files in the working branch
  • `$ git commit` Commit Changes
  • `$ git push` Push to Remote Repository

git-germancutraro See all the changes that happened between the working file and the staging file

git diff

See all the changes that happened between the staging area file and the committed file

git diff --staged

Recover Files

git checkout .

Delete all the changes added in a file

git checkout --

Add files and commit in the same command:

git commit -am 'README actualizado'

Edit the commit message

git commit --amend -m 'We edited the message!'

Add or Back to the last commit

git reset --soft HEAD^

Return to a specific commit in a weak way

git reset --soft 39ae8e6

Return to a specific commit in a hard way

git reset --hard 39ae8e6

List of originated commits

git reflog

Go back to a point

git reset --hard 43809d4

Rename Files

git mv index.js app.js

Delete Files

git rm app.js


A branch is basically a new timeline that stores commits. They are used to develop functionalities independent of each other. The master branch is the default branch when you create a repository. Create new branches during development and merge them to the main branch when you finish. git-germancutraro Create a branch:

git branch myBranch

See the branches of our repository:

git branch

Work in a specific branch

git checkout myBranch

Create and move to a branch in a single command

git checkout -b myBranch

Merge branches:

First we go back to the master branch:

git checkout master

And now we run the next command

git merge myBranch

Once merged we can proceed to delete the branch

git branch -d myBranch


Create a tag

git tag -a v1.0.0 -m "Version 1.0.0"

Insert a tag in a specific commit

git tag -a v0.1.0 43809d4 -m 'Alpha Version'

See all Tags

git tag

See the tag message

git show v1.0.0

Delete a tag

git tag -d v0.1.0



git stash

Get the list

git stash list


github-germancutraro Once we create a repository, we can add it to the remote server:

git remote add origin yourRepo.git

See the remote sources of our repository:

git remove -v

Once we have all our commits done and we have added the remote repository we can upload our files to Github: Push:

git push -u origin master

git-germancutraro But, as you can see, the tags are not uploaded with the `git push` command: git-germancutraro Push the tags

git push --tags

Ignore Files For this, you must create a .gitignore files, and there you can write the files and foulders that you dont want to upload to the github repository like:



git pull

git-germancutraro Clone a Repository

git clone repoUrl.git

Clone a repository in a specific folder

git clone repoUrl.git my-folder

About Author

Article is written by Pavan (a) KarthiQ. Well, I am serving notice period in an MNC, Bangalore. I thought to enrich every person knowledge a little, I always have a feeling, when we teach something, we will learn more than what you know. Knowledge is the only thing that doubles when you spend it.

I have also created the reporter for Protractor Jasmine. Use for your projects without any hesitation

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions