Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I log in using the Git terminal?

Tags:

git

git-bash

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.

like image 872
William Jones Avatar asked Sep 15 '19 18:09

William Jones


People also ask

How do I authenticate git in terminal?

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 is git log command?

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.


1 Answers

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

like image 177
user18004704 Avatar answered Oct 14 '22 15:10

user18004704