Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git push hangs up leading to internet problems

Tags:

git

github

The scenario is like this:

I have android source code (aosp) synced up. I want to make a "fork" of it in my repository. But since I was unable to find a way to fork just a specific branch and not the whole repo, I decided to manually push it. For this, I created a new bare repository on github.

My project has two remotes:

* aosp = https://android.googlesource.com/path_to_project.git
#The default remote using which I synced repo

* upstream = https://github.com/<my github user-name>/<newly created repo name>.git
#The remote I added manually

I tried to push it by following method:

#First added remote to that bare repository
git remote add upstream https://github.com/<my github user-name>/<newly created repo name>.git

#This is the branch for which I want to fork that project
git checkout -b kitkat-mr2.2-release

#I want the branch to be named kitkat in my own repo
git push -u upstream kitkat-mr2.2-release:kitkat

The output is as follows:

Counting objects: 869653, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (200676/200676), done.
Writing objects: 100% (869653/869653), 1.23 GiB | 101.65 MiB/s, done
Total 869653 (delta 582065), reused 867347 (delta 581182)

And then it remains there. A little web-search told me that its supposed to be so, so I consider its normal. But after sometime, my whole internet stops working. System Monitor still shows normal upload speed and such, but I am unable to use internet. It starts giving me this on every/any webpage:

enter image description here

Even any webpage I open on phone using wifi gives same result. And I have to restart my modem to get past this error/bug.

I also tried using git config http.postBuffer 1825361101 (again, a result of web-search) before the git push but it doesn't help either.

Please help me solve this issue. I am fairly new to github, still trying to figure a lot of things out. Thanks.

like image 542
Jaskaranbir Singh Avatar asked Jul 01 '15 08:07

Jaskaranbir Singh


People also ask

Does git push require internet?

When working off line, two Git tasks cannot be performed: fetching/pulling updates from the server, and pushing changes to the server. All other commands still work. One can commit changes, branch off, revert and reset changes, the same as when there exists an internet connection.

Why is git push failing?

This error mainly occurs when you attempt to push your local changes to GitHub while the local repository (repo) has not yet been updated with any changes made in the remote repo. So Git is trying to tell you to update the local repo with the current changes in the remote before pushing your own changes.

Why is git push taking so long?

If you are starting a new project from a clone, (from the CLI without a fork) when you push to a blank remote you are pushing the entire history of the project you just cloned. This is going to take some time.

What to do if 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.


1 Answers

With further research into problem, I found this solution which seems to work:

git config --global sendpack.sideband false

Now git push works fine.

like image 164
Jaskaranbir Singh Avatar answered Sep 30 '22 17:09

Jaskaranbir Singh