Как удалить новый файл, который был зафиксирован в HEAD - PullRequest
1 голос
/ 01 октября 2019

Я добавил пару новых файлов и добавил в ГОЛОВУ. Эти 2 файла не требуются, и я хотел бы удалить их полностью.

git status показывает следующее

Your branch is ahead of 'origin/adurai/istio-config' by 1 commit.
  (use "git push" to publish your local commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .idea/

nothing added to commit but untracked files present (use "git add" to track)

Ниже выводится git show --stat --oneline HEAD -

Выходные данные

bf3b6dc (HEAD -> adurai/config) Add base istio configurations
 terraform/platform/istio/common/istio-config/a.yaml                 | 13 +++++++++++++
 terraform/platform/istio/common/istio-config/b.yaml                 | 36 ++++++++++++++++++++++++++++++++++++
 terraform/platform/istio/common/istio-config/templates/gateway.yaml |  4 ++--
 terraform/platform/istio/common/istio-uninstall.sh                  |  2 +-
 4 files changed, 52 insertions(+), 3 deletions(-)

Файлы a.yaml и b.yaml не должны передаваться. Это новые файлы. Как мне их удалить?

Я уже пробовал git reset HEAD ./terraform/platform/istio/common/istio-config/a.yaml, но без помощи.

Любая помощь?

1 Ответ

0 голосов
/ 01 октября 2019

Удалите их:

git rm a.yaml b.yaml

А затем измените свой последний коммит:

git commit --amend
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...