0

gitconfig not reflecting after switching to user

Today i have installed Ubuntu20.04LTS . In that i had a user bob and his git config is like

user.name=Bob B
user.email=bob@example.com
alias.unadd=reset HEAD

I Had another user quealy . when i switched to the user quealy. using sudo -s -u quealy the bob gitconfig setting not reflecting .

Vikram
  • 25
  • 3
  • 1
    That's what I'd expect - because in Ubuntu 20.04, `sudo -s -u quealy` sets the `$HOME` environment variable to that of the target user (and so `git -config` looks for user quealy's `$HOME/.gitconfig` file). See for example [How does sudo handle $HOME differently since 19.10?](https://askubuntu.com/questions/1186999/how-does-sudo-handle-home-differently-since-19-10) – steeldriver May 21 '21 at 13:25
  • Thanks a lot works fine – Vikram May 21 '21 at 14:00

0 Answers0