I am working on a project and I forked a repo from a team member who forked it from the original repo. He created a new branch with the same files and made changes in it.
However I cloned the original repo and worked on it and now I want to push the changes to my forked repo to the new branch he created. I went into the folder I made changes in, and I ran the following commands
git add .
git commit
git push
and I got
fatal: remote error: access denied ... /original-repo/project.git
I followed the instructions here: How can I push to my fork from a clone of the original repo?
but when I tried to run
git remote set-url origin https://github.com/xxx/project.git”
I got “fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Then I tried :
git remote add stash ssh://git@w.x.y.z:7999/xxx/project.git
git push stash master
and I got
ssh: connect to host w.x.y.z port 7999: Connection timed out
although I set up my ssh key and was able to ssh successfully
Finally I thought about adding my fork, so I ran
git remote add fork https://github.com/xxx/project
git push fork master
and it prompted me for my username and password, then I got the following:
To https://github.com/xxx/project ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://github.com/xxx/project' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
EDITS:
I ran
git pull origin master
and got
fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I ran
git pull github.com/xxx/project master
fatal: 'github.com/xxx/project' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I am really not sure what to do, I really appreciate any help