I am trying to sign in using the Git command line, so that I can push my changes to a repository I have. I usually use a different account to the one I'm trying to use right now, and pushing works fine on there. The terminal is the one integrated into Visual Studio Code, and it is Git Bash.
What I want to do is sign into this different account and then push from that account. I remember at one point there was a popup with a login box on it. How would I get this to show up again?
So far, I have tried using the commands:
git config user.name my-name
git config user.email my-email
Which don't appear to have asked for any credentials. Upon Googling (just now) it appears that they are used just to set my commit username.
So how do I log in from the Git command line? I've been stuck on this for ages and I feel like there's probably a really simple solution.
Any help would be greatly appreciated.
There are three main approaches you can take: Using a personal authentication token or password. Using an SSH key. Using your GitHub password with 2-factor authentication.
What does git log do? The git log command displays all of the commits in a repository's history. By default, the command displays each commit's: Secure Hash Algorithm (SHA) author.
Just entering your user in the command line won't work for newer versions of git. To sign in, you'll need to download git CLI, then do gh auth login
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With