Skip to content

Set commit author name and email #4487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sclause2412 opened this issue Apr 15, 2025 · 0 comments
Open

Set commit author name and email #4487

sclause2412 opened this issue Apr 15, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@sclause2412
Copy link

Is your feature request related to a problem? Please describe.
If I checkout a repository and want to commit something it fails with "Author identity unknown". This is because I have NOT set an author globally. I do not want to do it globally because I sometimes want to commit with my private account and sometimes with my work account. If I set it globally I will forget to change and then I have issues solving it out.

Describe the solution you'd like
If there is no author given then lazygit could inform and ask for an author. Could be same dialog as for "Amend commit attribute..." command.
Another possibility is to just have a keybinding for setting an author. Example: Use similar keybinding as for "Amend commit attribute..." (e.g. Ctrl+a) but if used in Files view then it is called "Set author...".

Describe alternatives you've considered
Custom Commands can be used - but hey, it's a feature request, not a bug :-)

Additional context
Custom command version:

customCommands:
  - key: '<c-a>'
    context: 'files'
    description: 'Set author'
    prompts:
      - type: 'input'
        title: 'What is the new author name?'
        key: 'Author'
        initialValue: ''
        suggestions:
          preset: 'authors'
    command: 'git config user.name "$(echo "{{.Form.Author}}" | sed -E "s/^(.*) <.*>$/\1/")" && git config user.email "$(echo "{{.Form.Author}}" | se>
@sclause2412 sclause2412 added the enhancement New feature or request label Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant