https://proglib.io/p/git-for-half-an-hour

Система контроля версий


sudo apt-get install git && sudo zypper  install git && sudo dnf     install git

git config --global user.name     "My Name"
git config --global user.email    myEmail@example.com
git config --global color.ui true
git config --global color.status auto
git config --global color.branch auto
sudo git config --global pager.all more  # задать пейджер
git config --global pager.log false      # задать пейджер для команды log
git config --global core.pager "less -FRSX" # -F не пагинировать мелкий output

Конфигурационные настройки хранятся в:
  /project/dir/.git/config     # git config
  /etc/gitconfig               # git config --global
  ~user/.gitconfig  # --global # sudo git config --global

git config --list   # просмотр настроек

git --help
git komanda --help   # help po komande
git status           # status



cd project/dir
git init



git add [ список файлов ]
git add .     # все что есть в директории
git add -M    # добавит все, учтет удаленные файлы

git rm [ список файлов ] удаляет файлы из директории и из git'а

git reset [ список файлов ]  # ???

git ls-files           # список добавленного
git ls-files --others  # список всех недобавленных
git ls-files --others --exclude-standard  # не показывать игнорируемые

.gitignore   список файлов, которые исключаются из контроля
 file
 dirname/
 *.obj        действует на подкаталоги
 / *.obj      действует только на начальный каталог



git commit -m "Comment Mesage"
git log
git show 953e115f9e54b6850415267fce3131dbddb48703



git log

git checkout 09bd8cc1 hello.txt    # вытащить старую версию файла

git checkout 09bd8cc1             # отклатиться в коммит





Популярность: 3, Last-modified: Wed, 08 Jul 2026 16:41:00 GmT