29
$ git remote set-url origin https://demodev@servername.com/home/demodev/public_html/waqtpar.git`

$ git push -u origin master`

fatal: unable to update url base from redirection: asked for: https://demodev@servername.com:/home/demodev/public_html/waqtpar.git/info/refs?service=git-receive-pack redirect: https://demodev@servername.com:/404.html`

mickmackusa
  • 43,625
  • 12
  • 83
  • 136
Balaji R
  • 402
  • 1
  • 4
  • 8

7 Answers7

19

Well, as the error says. You are getting a 404 error page which means website is not found. Git of course cannot handle this redirect in this case and so complains.

Your URL is simply wrong. Did you maybe want to use

ssh://demodev@servername.com/home/demodev/public_html/waqtpar.git

or

demodev@servername.com:/home/demodev/public_html/waqtpar.git

or

https://demodev@servername.com/~demodev/waqtpar.git

S.I.
  • 3,250
  • 12
  • 48
  • 77
Vampire
  • 35,631
  • 4
  • 76
  • 102
  • 1
    $ git push -u origin master ssh: connect to host servername.com port 22: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. – Balaji R May 11 '17 at 11:16
  • 1
    Well, then you obviously do not have SSH access to that box and the first two URLs which are SSH URLs will not work. Ask the one responsible for the remote repository under which URL you might access it. – Vampire May 11 '17 at 13:14
19

You may be using browser url instead of git repository clone url.

The url has to end with .git

Kris
  • 719
  • 1
  • 11
  • 19
2

I just met this problem. I fixed this by disabling proxy (I'm using TortoiseGit)

sanbrother
  • 244
  • 3
  • 5
0

In my case .gitconfig file had a http.proxy setting but the TFS repo was not outside the corporate network. When git was trying to use the proxy, the traffic was being blocked by the proxy. When I removed the proxy setting from .gitconfig, git push command worked!

Cagin Uludamar
  • 372
  • 1
  • 3
  • 16
0

My problem was solved after using SSH instead of HTTPS.

You can also configure this to be automatically done. (see this link)

Mostafa Ghadimi
  • 5,883
  • 8
  • 64
  • 102
-2

Steps followed for cloning in command line:

>mkdir <folder name>

>git init

>git clone http[s]://host.xz[:port]/path/to/repo.git/

or

>git clone ssh://[user@]host.xz[:port]/path/to/repo.git/
Abhishek Gurjar
  • 7,426
  • 10
  • 37
  • 45
Kanav
  • 135
  • 1
  • 3
-2

If you use VisualStudioCode/ left menu / source control / remotes / fetch

and thats all, you can use push as normally