20

i used git before without any problem, but suddenly i can't push or clone anything. when i use this command, just nothing happens, not even an error, so i have to press ctrl + c or just close git window.
i use this simple command for pushing:

git push origin master

also tried with -u parameter.

  1. i opened port 22 in my firewall, no luck
  2. i use both http and ssh, again no luck
  3. i install a new version of git, no luck

so what i can do to solve this?

Update:

i installed a fresh win xp on virtual machine and test to push something, same result as before, so may be my internet connection have some problem.

any idea?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
mehdok
  • 1,499
  • 4
  • 29
  • 54
  • 1
    No error? what output *do* you get? – Carl Norum Jun 16 '13 at 03:11
  • 1
    nothing, just a blinking cursor, no matter how long i wait. – mehdok Jun 16 '13 at 03:26
  • 1
    That doesn't sound like a problem with git; anything else crazy happening on your machine? – Carl Norum Jun 16 '13 at 03:28
  • 1
    i don't know, yesterday it worked fine, now it doesn't. i just install NODEJS, and jitsu cli since then, is it possible that make problem? i don't think so. – mehdok Jun 16 '13 at 03:31
  • 3
    Were you able to resolve this issue? I have exactly the same problem, simply trying to push a local working directory to a fresh github repo – Heisenberg Oct 18 '13 at 16:42
  • @Anh: in my case the problem was from github and it solved by itself, maybe one or 2 days after the problem appears. – mehdok Oct 20 '13 at 07:36
  • Check out this article to set up ssh: https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git I also had to set up git to disable verifying SSL: >$ GIT_SSL_NO_VERIFY=true git push – bschwagg Feb 05 '15 at 01:43

11 Answers11

16

Update 2021: this is again an issue, when pushing with HTTPS URL, with Git 2.32 (June 2021).

See details here: there is a bug with the Microsoft Git Credential Manager Core, which is why, as Pinak Ganguly suggests, you might want to switch temporarely to the obsolete Git Credential Manager:

git config --global credential.helper manager

First, there was some issue with ssh access recently:

We are currently investigating SSH access problems on one of our fileserver pairs. A small number of repositories may be affected.

Second, you would need to try and use https, not http:

git remote set-url origin https://github.com/username/reponame

Third, the git push -u origin master is only for the first push (after that, git push alone is enough: see "Why do I need to explicitly push a new branch?" for more)

If the push or clone issue still persists, then you need to contact GitHub support to know more about this.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
9

Here is a little out of the box thinking.

Do you have a VPN on?

Close all of your applications including the VPN and terminal then try again.

It is amazing how many times just turning things off then on has helped at times, sometimes things just get stuck and need a "power start" may it serve you as well too.

jasonleonhard
  • 12,047
  • 89
  • 66
  • 2
    This happened for me. I closed VPN and everything works fine. – Cuong Vo Mar 13 '22 at 19:18
  • 1
    I was working on university project and It requires to be connected with university vpn. Thanks I just connect to VPN and everything now works well. – pramodpxi Apr 04 '22 at 19:20
6

In my case the https connection was not working. Change remote origin url, not using https but git

git remote set-url origin git@github.com:username/reponame.git

This url can be found on your github or gitlab project page

Matoeil
  • 6,851
  • 11
  • 54
  • 77
1

Add

git remote set-url "https://github.com/targetusername/targetrepo"

after

git remote add "https://github.com/targetusername/targetrepo"

and before

git push -u origin master
figs_and_nuts
  • 4,870
  • 2
  • 31
  • 56
1

I had messed with multiple repositories and for some reason, the force argument solved the problem.

git push --force origin master
Agnel Vishal
  • 564
  • 6
  • 13
  • It worked with me too, same problem and get stuck at Total....pack reused 0. Maybe it is a problem of branchs in your system idk i didn't use a master branch ... – Marinos TBH Jul 21 '22 at 11:55
1

Just wanted to contribute yet another reason this can happen: if the remote you're pushing to has IP filters in place, it will blink with no output. In my case, my laptop was connected with WiFi which was not connecting through a whitelisted IP address.

C. Griffin
  • 681
  • 1
  • 12
  • 32
1

It turns out that the root cause might be the underlying network devices/drivers. Try rebooting your machine; or as a workaround add the following to your ~/.ssh/config:

Host *
IPQoS lowdelay throughput
yeshengm
  • 557
  • 5
  • 13
1

This is an issue with the installation may be with the latest GIT version(2.32.0).

To fix it, you have to reinstall git and select the highlighted option when this screen comes up.

Simas Joneliunas
  • 2,890
  • 20
  • 28
  • 35
0

It maybe be related to yout ssh client. Can you ssh login the a remote server? The -v verbose option is very usefull here.

ssh -v -p PORT USER@SERVER

More details here: https://stackoverflow.com/a/60205342/195812

Augusto
  • 2,125
  • 18
  • 27
0

Recently I have faced the same problem and I solved the problem following bellow steps

  1. Make sure you have put the correct user name and email.

    git config --global user.name "Your Name"
    git config --global user.email "youremail@gmail.com"
    
  2. Now run this command

    git config --list
    
  3. You will see the output like this

    user.name=Your Name
    user.email=youremail@gmail.com
    
  4. Finally it works for me

TT.
  • 15,774
  • 6
  • 47
  • 88
Nazmul Hoque
  • 761
  • 9
  • 9
0

This worked for me.

git config --global credential.helper manager
git config --global user.name "Your Name"
git config --global user.email "youremail@gmail.com"
Pana
  • 29
  • 2