menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Devops News

>

How to Set...
source image

Dev

2w

read

64

img
dot

Image Credit: Dev

How to Set Git user.name and user.email Based on the Most Recent Commit

  • To set Git user.name and user.email based on the most recent commit, you can use the following commands:
  • To extract the name of the author of the most recent commit, use the command: git log -1 --pretty=format:'%an'
  • To extract the email of the author of the most recent commit, use the command: git log -1 --pretty=format:'%ae'
  • To set the author details globally, use the command: git config --global user.name "$(git log -1 --pretty=format:'%an')"; git config --global user.email "$(git log -1 --pretty=format:'%ae')"

Read Full Article

like

3 Likes

For uninterrupted reading, download the app