4

I have been pulling from this repo, and I recently had some changes that I wanted to push, so I tried the usual git push origin master, only to find out that it doesn’t work:

19:02 $ git push origin master
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

But I am able to pull from the repo:

19:02 $ git pull origin master
From <url>
* branch            master     -> FETCH_HEAD
Already up-to-date.

I know that must be correct since I am able to pull. According to my admin (whom I asked this question), I have developer rights which means I should be able to both pull and push. What could be the issue?

makansij
  • 9,303
  • 37
  • 105
  • 183
  • I checked out this answer: https://stackoverflow.com/questions/28093935/git-pull-is-working-but-git-push-isnt, but I do not know where the `refs` are that the answer talks about...? – makansij Jan 20 '18 at 17:07
  • Have you tried it with an explicit `--set-upstream-to`? – jmargolisvt Jan 20 '18 at 17:16
  • 1
    `Please make sure you have the correct access rights` ... you should make sure that you have the correct access rights. Generally writing needs greater rights than just reading. By the way, what is your Git host (e.g. GitHub, Bitbucket, etc.) ? – Tim Biegeleisen Jan 20 '18 at 17:20
  • host is github.com. I checked my rights and I have read and write access. – makansij Jan 20 '18 at 18:00
  • 2
    Show the output of `git remote -v` please. – poke Jan 21 '18 at 00:01
  • It is highly likely your 'remote' is set to use "git@" which requires SSH access and you do not have the correct access rights. As already mentioned, check `git remote -v`. You will, likely, need to update the remote to "https://..." with `git remote set-url origin ` – Thom Parkin Jan 22 '18 at 15:41
  • 2
    I have tried both `http` and `ssh` - neither one works. Furthermore - why am I able to `git pull origin master` but I cannot `git push origin master`? it is using the same url right? – makansij Jan 25 '18 at 04:19

1 Answers1

1

Most likely this is related to either an outdated git version or to missing access rights in your repository if you are using github, bitbucket or similar.

lukas_o
  • 3,776
  • 4
  • 34
  • 50