jesseduffield / jesseduffield/lazygit
Set commit author name and email
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**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:
```yaml
customCommands:
- key: ''
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>
```
Contributor guide
Assessment
This issue has not been assessed yet.