8000 Git reset hard does not reset modified files if they are excluded in .gitignore · Issue #819 · go-git/go-git · GitHub
[go: up one dir, main page]

Skip to content
Git reset hard does not reset modified files if they are excluded in .gitignore #819
@daolis

Description

@daolis

It happens in some cases that after the checkout of an branch the worktree is in unClean state.

If you want to reset this changes (withg Mode: git.HardReset) everything should be reverted.

BUT: If the modified file is also excluded in the .gitignore file then this file is not reverted.
If you run the command with the git console client (git reset --hard) all is reverted as expected.

Test application to reproduce the issue: https://github.com/daolis/gogit-reset-bug

This behaviour was introduced with cf51e2febf37 #718
FYI @cbbm142 @pjbgf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0