Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stuck at push, nothing happens

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?

like image 491
mehdok Avatar asked Jun 16 '13 02:06

mehdok


People also ask

Why my git push is not working?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

Why push is getting rejected?

A commit gets rejected and causes a failed to push some refs to error because the remote branch contains code that you do not have locally. What this means is that your local git repository is not compatible with the remote origin. Based on the above, your local machine is missing commits C and D.

What happens after git push?

The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch , but whereas fetching imports commits to local branches, pushing exports commits to remote branches.

How do I force push to master?

To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch).


2 Answers

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.

like image 89
VonC Avatar answered Oct 13 '22 19:10

VonC


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.

like image 37
jasonleonhard Avatar answered Oct 13 '22 18:10

jasonleonhard