How to reset password for Git on Windows and macOS?

April 06, 2022 No comments Git password update

1. Introduction

In this article, we will focus on how to update the password for Git on Windows and macOS. Everyone who worked in a corporation in which changing the domain password is required every often, and the Git system is connected with the domain account, probably faces that problem.

2. How to update the password for Git

  • On Windows open the console and enter the following command:

    git config --global credential.helper wincred
    
  • For macOS use the following command:

    git config --global credential.helper osxkeychain
    
  • For macOS Sierra 10.12.4 use:

    git config --global --unset user.password
    

Note that this command doesn't change the password directly, but rather reset stored credentials. You will be asked to enter a new username and password after the next Git action like push, pull, etc.

3. Conclusion

In this article, we presented the best way to update Git passwords on Windows and macOS.

{{ message }}

{{ 'Comments are closed.' | trans }}