0

I read various answers over Stackoverflow but none helped.

Here's the situation. I cloned a public repo and made a new branch and then commit my changes in the branch and now I want to push the branch.

(base) mona@goku:~/research/summer2020/synthetic-computer-vision$ git push -u origin master sidod
Username for 'https://github.com': monajalal
Password for 'https://[email protected]': 
remote: Permission to unrealcv/synthetic-computer-vision.git denied to monajalal.
fatal: unable to access 'https://github.com/unrealcv/synthetic-computer-vision.git/': The requested URL returned error: 403

here's the result of:

$ git config --list
credential.helper=osxkeychain
user.name=Mona Jalal
[email protected]
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/unrealcv/synthetic-computer-vision.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

I created a new RSA and pasted it to my git setting after deleting the old one. I even deleted the entries of git in the keychain access:

enter image description here

now it is: enter image description here

How can I fix this?

other information:

$ git status
On branch sidod
nothing to commit, working tree clean


$ git --version
git version 2.24.3 (Apple Git-128)

$ git branch
  master
* sidod

I am using OSX 10.15.2

Here is the public git repo I have cloned: https://github.com/unrealcv/synthetic-computer-vision

enter image description here

2 Answers 2

2

It looks like you're attempting to push to the original repo. You need to remove that remote, and add the remote for your fork, then push to that.

Sign up to request clarification or add additional context in comments.

4 Comments

No real need to remove that remote. The OP can add a second remote (git remote add mine url-to-my-repo), then the branch can be pushed to that second remote and the PR then can be requested against the original repo.
Personally, I find Git easier to manage when every working directory is managed the same way: origin is a remote repo that I can push to, or is the primary repo. If later on OP needs to interact with the original source of the fork, they can always add it again. Leaving multiple remotes attached when origin isn't being used is a recipe for confusion and interacting with the wrong repo in future.
Why not git remote set-url origin url-to-my-repo?
For me personally, it's much easier to memorise and use a small number of commands (in this case, git remote rm ..., git remote add ...)
0

Try

rm ~/.gitconfig
touch ~/.gitconfig

Then

git config --global user.email <[email protected]>
git config --global user.name <my-username>

Go to your Personal access tokens, generate new access token, and copy this one and paste it when you're asked to put your password after git push origin main.

For me after doing that, I found 'github.com' had been generated automatically again into Keychain Access.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.