🛰️Git: Основные команды

help

git <command> --help  # Откроет информацию по запрашиваемой команде
git commit --help  # Пример

init

git init  # Создать репозиторий. (Сделать текущую директорию новым репозиторием)
git init <name>  # Создать репозиторий в текущей директории с именем <name>
git init basic-git  # Пример

clone

git clone <remote-url>
git clone https://github.com/LpilinAlexandr/basic-git.git  # Пример через http
git clone git@github.com:LpilinAlexandr/basic-git.git  # Пример через ssh

remote

git remote set-url origin https://github.com/LpilinAlexandr/basic-git123.git  # Изменить в origin remote адрес
git remote add test https://github.com/LpilinAlexandr/basic-git123.git  # Установить новый remote адрес
git remote -v  # Посмотреть список всех remote адресов

config

status

add | restore | rm

stash

commit

log

revert

reset

cherry-pick

branch

switch | checkout

merge

rebase

fetch

pull

push

reflog

Last updated

Was this helpful?