Categories
Полезное

Git

Git 

https://www.atlassian.com/git/tutorials/syncing/git-remote

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

Ω 

git config –global user.name “Your Name”

git config –global user.email “your_email@whatever.com”

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”

History

git log

git log —-pretty=oneline

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

Aliases

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

[alias]

  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 – 

https://git-scm.com/book/ru/v1/%D0%9E%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-Git-%D0%97%D0%B0%D0%BF%D0%B8%D1%81%D1%8C-%D0%B8%D0%B7%D0%BC%D0%B5%D0%BD%D0%B5%D0%BD%D0%B8%D0%B9-%D0%B2-%D1%80%D0%B5%D0%BF%D0%BE%D0%B7%D0%B8%D1%82%D0%BE%D1%80%D0%B8%D0%B9

git clean  -d  -fx “”

http://www.kernel.org/pub/software/scm/git/docs/git-clean.html

-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