0

When i try to git push, i see this message:

remote: Permission to Karetski/univercube.git denied to PavelMetsko. fatal: unable to access 'https://github.com/Karetski/univercube.git/': The requested URL returned error: 403

But in git config i see another user.name

push.default=simple
core.autocrlf=true
user.email=karetski@gmail.com
user.name=Karetski
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/Karetski/univercube.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

How to fix this thing? I need "Karetski" username instead of "PavelMetsko"

  • .gitconfig is stored in 3 places. Per-system, per-user and per-repository. They can overwrite each other. Have you checked all of them? – LeChiffre Sep 21 '15 at 23:07
  • I check --global config and repository config. Where can i find other? I use OS X Yosemite – Alexey Karetski Sep 21 '15 at 23:33
  • Git doesn't provide a user name (nor password). When using https as your protocol, it's a "credential helper" that provides these. See https://help.github.com/articles/caching-your-github-password-in-git/ for details. (Using ssh, git still doesn't provide a user name or password either, but the setup seems a bit more straightforward to me with ssh.) – torek Sep 22 '15 at 00:13
  • Thank you @torek . Your answer is amazing. It really helps!!! – Alexey Karetski Sep 22 '15 at 00:25
  • Does this answer your question? [How do I update the password for Git?](https://stackoverflow.com/questions/20195304/how-do-i-update-the-password-for-git) – Daemon Painter Sep 02 '20 at 07:48

1 Answers1

1

user.name is not for access control, it is what is used for your commits.

user.name

Your full name to be recorded in any newly created commits. Can be overridden by the GIT_AUTHOR_NAME and GIT_COMMITTER_NAME environment variables. See git-commit-tree(1).

What you need to set are your credentials.

[credential "https://github.com/Karetski/univercube.git"]
    username = Karetski
Community
  • 1
  • 1
Schwern
  • 153,029
  • 25
  • 195
  • 336