jesseduffield / jesseduffield/lazygit

Set commit author name and email

Open
#4,487 3 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.