git config –global core.editor /usr/bin/vim


git config –global “Your Name”

git config –global “”

Create a repository

git init

Add the page to the repository

git add hello.html

git commit -m “First Commit”

-m flag gives a comment on the command line

Check the status of the repository

git status

Adding changes or undo 

git add git add .(add all) or git checkout or git unstage

git status

Staging and committing

git commit -m “cimment fot commit”


git log

git log —-pretty=oneline

git log —-all —-pretty=format: “%h %cd %s (%an)” —-since=‘7 days ago’


Add the following to the .gitconfig file in your $HOME directory.


  co = checkout

  ci = commit

  st = status

  br = branch

  hist = log –pretty=format:\”%h %ad | %s%d [%an]\” –graph –date=short

  type = cat-file -t

  dump = cat-file -p

alias gs=’git status ‘

alias ga=’git add ‘

alias gb=’git branch ‘

alias gc=’git commit’

alias gd=’git diff’

alias go=’git checkout ‘

alias gk=’gitk –all&’

alias gx=’gitx –all’

alias got=’git ‘

alias get=’git ‘

Cloning repository

git clone (ssh or urli repo)

git add .

git commit -m “First commit”

git push origin master

.gitignore – файл с шаблонами игнорируемых файлов

git diff –

git clean  -d  -fx “”

-x means ignored files are also removed as well as files unknown to git.

-d means remove untracked directories in addition to untracked files.

-f is required to force it to run.

git checkout . – unstage all files

Leave a Reply