I have a Git
repository with about 4 branches. They are put up on GitHub
. I recently created a new branch, named "demo2Full". Since creating that, I am unable to push to an earlier branch called "bugfixes". Here is what I did to create the new branch:
git remote add demo2Full git@github-user:user/project_demo2Full.git
git branch demo2Full
& git checkout demo2Full
. After that I switched back to "bugfixes" with git checkout bugfixes
without any issues.
Now, when I do: git push origin bugfixes
, I get the following error:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have gone through a number of links, including this one on GitHub.
The SSH
part works, and I have also checked the remotes with git remote -v
and the config file at .git/config
and found that there are no spelling mistakes etc. in the links.
Where am I going wrong?
Edit
Also, having a separate entry in the config file for each branch like:
git@github-userName:userName/projectName_branchName.git
is correct?
The .git/config
file had an "incorrect" entry.
The origin was listed as: url = git@github-userName:userName
.
Changing that to : url = git@github-userName:userName/projectName.git
rectified the error.
I am still not clear about how that change happened in the first place.