1

It seems that my local Git environment is messed up.

While my colleague can sync up the remote repository, I can't either pull or push due to a repository not found an error:

fatal: repository 'https://github.com/my-organization/my-project.git/' not found

The repository name in the config list (see below) doesn't have a trailing slash.

That happens after 2FA setup. I think that a fresh git local environment may solve the problem. After some online search, I can't find related information. That lets me wondering whether I am on a right track or not. If yes, how to approach it? If no, what will be a solution?

Also,

$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Users/me/AppData/Local/Programs/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=cache
user.name=me
user.email=me@abc.com
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=https://github.com/my-organization/my-project.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.dev.remote=origin
branch.dev.merge=refs/heads/dev
branch.me/slt-682.remote=origin
branch.me/slt-682.merge=refs/heads/me/slt-682
branch.me/slt-697.remote=origin
branch.me/slt-697.merge=refs/heads/me/slt-697
branch.tmp_release.remote=origin
branch.tmp_release.merge=refs/heads/tmp_release
branch.unblock_auth.remote=origin
branch.unblock_auth.merge=refs/heads/unblock_auth
branch.predev.remote=origin
branch.predev.merge=refs/heads/predev
vic
  • 2,548
  • 9
  • 44
  • 74
  • Does everything work if you turn off 2FA? – Schwern Jul 26 '18 at 19:24
  • A few days ago, everything worked fine again after switching back to the regular authentication from 2FA. I can't switch back this time because 2FA is enforced. – vic Jul 26 '18 at 19:37
  • config --system --list does not matter: only git config --list (which will list all settings) matters. – VonC Jul 26 '18 at 20:08

1 Answers1

2

That happens after 2FA setup.

That means you no longer can use directly your GitHub account password, and must use a PAT instead (Personal Access Token)

But: said username and password might already be cached, through a credential helper:

git config credential.helper

In that case, you need to remove the entry for github.com in that helper, in order for you to use another authentication (same account, but with a PAT).
Here is an example for Windows.

For the "cache" credential helper, killing the credential cache daemon should be enough.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackoverflow.com/rooms/176834/discussion-on-answer-by-vonc-git-local-environment-reset). – Bhargav Rao Jul 26 '18 at 21:50