# Базові Git-команди

Задати e-mail та ім’я

```bash
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
```

Ініціалізувати порожній локальний Git-репозиторій

```bash
git init
```

Клонувати репозиторій, що існує, по HTTP (на прикладі GitHub)

```bash
git clone https://github.com/{vendor_name}/{project_name}.git
```

Або клонувати репозиторій, що існує, за допомогою SSH

```bash
git clone git@github.com:{vendor_name}/{project_name}.git
```

Перевірити стан

```bash
git status
```

Перевірити, чи потрібен pull

```bash
git status -uno
```

Додати файл(и) в індекс

```bash
git add file_name
```

Додати всі файли в індекс

```bash
git add .
```

Покласти зміни в локальний репозиторій

```bash
git commit
```

Покласти зміни в локальний репозиторій і додати одразу коментар

```bash
git commit -m "Comment text here..."
```

Покласти зміни з локального у віддалений репозиторій

```bash
git push
```

Оновити дані (забрати зміни) з віддаленого репозиторію по поточній гілці

```bash
git pull
```

Створити локальну гілку з назвою branch\_name

```bash
git branch branch_name
```

Показати лише локальні гілки

```bash
git branch
```

Показати всі локальні та віддалені (remote) гілки

```bash
git branch -a
```

Показати лише віддалені (remote) гілки

```bash
git branch -r
```

Змінити гілку на branch\_name

```bash
git checkout branch_name
```

Створити гілку на своєму локальному комп'ютері та перейти в цю гілку

```bash
git checkout -b branch_name
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vyspiansky.gitbook.io/introduction-to-web-development/git/git-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
