0

I tried make new repository on my GitHub, but I can't because before I made another account on GitHub and now when I'm trying make new repository with new account I have error :

<myenv> C:\Users\my-user\my-folder\> git push origin master
remote: Permission to new-user/repo.git denied to OLDUSER.
fatal: unable to access 'https://github.com/new-user/repo.git/' :
The requested URL returned error: 403

When I try add origin remote I got this error :

fatal: remote origin already exists.

I tried edit the .git/config file in my working directory, but nothing helps. So i have question, can I remove OLDUSER from GitHub to make new repository with my new-user?

I tried also this :

git remote rm origin 

and after :

git remote add origin https://github.com/new-user/repo.git
git push -u origin master

I got this error :

fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository

Please make sure you have the correct acces rights
and the repository exists.
  • Don't you have to create the repository from the website? Hence: https://help.github.com/articles/create-a-repo/ – ifconfig Sep 03 '17 at 19:40
  • I created my new repository, but i can't add repo from git on my computer to GitHub on my console, cuz GitHub working with old user with old repository and I don't know why and I can't change to new user – Emilia293 Sep 03 '17 at 21:20
  • The error is saying that github.com/new-user/repo is not the url of a respository. Are you sure the repo exists? – ifconfig Sep 03 '17 at 21:35
  • Yes I'm sure I created new repository on new account GitHub, but it still use olduser from old account GitHub. – Emilia293 Sep 03 '17 at 21:54
  • Is the url you gave (github.com/new-user/repo) the real link to the repo or is it just a placeholder? – ifconfig Sep 03 '17 at 21:55
  • my real link is (github.com/dupa-maryni/dupadupa) I gave just placeholder but on my console I use my real link. – Emilia293 Sep 03 '17 at 21:58

2 Answers2

1

check the user who did your local repo:

git config user.name

it's probably still OLDUSER

also, you will probably need to change the user who did the commit: (all is here : Change the author and committer name and e-mail of multiple commits in Git )

sab
  • 4,352
  • 7
  • 36
  • 60
0

Ok, nothing was working any command and other, so I decided to delete my old repository from my old GitHub and I deleted my old account on GitHub and now I can add normally my repository to my GitHub. Thanks for your answers ;)