0

***EDIT Yes, I know there are other posts with the answer! What do you think I have doing the last 5 hours? NONE of those questions matched mine. But you would have to read the whole post instead of just the title. AND to be fair, every comment so far has yet give an answer, only that it is best practice to use SSH. Which is totally fine, that's what I will do. But to mark my question as duplicate, it's not. ***END

Pulling my hair out here. Tried everything SO has suggested, but nothing works. I am running on Ubuntu 21.04, git version 2.30.2, and the repo is hosted on AWS CodeCommit if that makes any difference.

When I cloned the repo, I added my username/password manually, and everything works fine. I then follow the instructions:

git config --global user.name 'MyUsername'
git config --global user.password 'PasswordGivenToMeByAWSx+QrkXg/CIxJjxuNo='
git pull

I do those commands, just like that, in that order, and I am then prompted to type in my username. What am I doing wrong?

mmaceachran
  • 3,178
  • 7
  • 53
  • 102
  • Afaik if you are using https, it needs to be something like "h t t p s://user:password@whatever.com" as your remote. However It is better to use the ssh protocol with a private key. https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-unixes.html#setting-up-ssh-unixes-keys – Rani Sharim Oct 12 '21 at 04:19
  • 1
    There is no `user.password` setting. The `user.name` setting is not used for *authentication*, it merely goes into *new commits you make*. – torek Oct 12 '21 at 04:35
  • 1
    Remember that Git itself never does any authentication. If you use ssh, Git lets ssh do the authentication. If you use https, Git lets libcurl and a web server do the authentication. Git doesn't get involved here. However, for libcurl purposes, Git can run a *credential helper*, which will obtain and pass on a user name and password. There are many credential helpers, several of which come with Git; they vary by OS. Linux comes with the simple store (in a file) and cache (for some time) ones. – torek Oct 12 '21 at 04:38

0 Answers0