/
Вопросы и ответы
/
Git
/

Как добавить файл в индекс git репозитория

Как добавить файл в индекс git репозитория

3 года назад

Andrey Moshkov

Ответы

0

Добавить файл в индекс можно с помощью git add

touch file.txt
git st
# On branch main
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
# 	file.txt
# 
# nothing added to commit but untracked files present (use "git add" to track)
git add file.txt
git st
# On branch main
# Changes to be committed:
#   (use "git restore --staged <file>..." to unstage)
# 	new file:   file.txt

3 года назад

Ivan Mamtsev