Configure Git in windows like a pro
A step by step guide to configure git on windows machine
27 November, 2022
4
4
0
Contributors
Getting started
Last day when I was working on a project I faced some difficulties in pushing my commits to my secondary github account and the error which my terminal showed me a 403 unauthorized access.

The problem
Well it is preety simple , my computer have the access to push commits to my primary github account as I have configured my email in the global setting but while I am trying to push my code to my seconday github account which dosen't knows about my machine showed me unauthorised access.

solving the problem
Well tbh at first I thought to uninstall git from my machine so that I can reconfigure everything but I but how many times should I do that, It's not a cool approach

windows credential manager

and select windows credentials
Under the
generic credentail
column you will find the github credential for your local computer now you can either edit it with the another github password or can completely remove it . Well I'm choosing the second one
Now quickly open up the terminal(power shell) and let's do some reverse engineering.

Now hit
rm ~./gitconfig
this will entirely delete the git configuration file from your machine
Now hit git config --global user.name "Your Name "
then hit git config --global user.email="Your email id "
and finaly check everything by hitting git config --global --list
Ok we are done with the globla configurations so its time for psuhing some commits to GitHub
When you hit git push
you will be promted with an auth pop up.
Click on signup with browser
Finally check your global configurations with
git config --global --list

Use cases
•
when you are working with multiple git providers like github , gitlab or bigbucket
•
Having 2 github or gitlab accounts
•
changed username or email
Conclusion
Congratulations we have reached the end you just have learned to configure git in windows machine just using terminal. Make sure to share this with your peers and feel free to hit a reaction amd follow my page . Stay tuned for the next. Happy Hacking :)
tutorial
git
github
devops
develevate