Skip to content

Use sudo if .git owner is owned by root/other user #78

@vguttmann

Description

@vguttmann

I'm using git to manage my nixOS config, and the config (and associated git repo) are owned by root.

I configure my credentials on a per-repo basis, since there are a few different orgs I work for.

As such, when I execute any git command without sudo, git asks for a password, because it can't read the credential file in .git, so I have to interrupt.

It'd be helpful if pay-respects used sudo/su to execute the command as the user that owns the .git directory if the last command was a git command that was interrupted/failed (if there aren't other, more specific checks that apply first, I'd think of this more as a base case)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions