Tuesday, February 22, 2022

[SOLVED] GitHub: Linux Android Kernel source. Cannot push or pull

Issue

I am trying to push my kernel source to github but I get an error:

$ git push origin master
Write failed: Broken pipe13/37078), 10.77 MiB | 65 KiB/s   
fatal: The remote end hung up unexpectedly
error: pack-objects died of signal 13
error: failed to push some refs to '[email protected]:Lopicl/ThunderKernel_cooperve.git'

Please, what i do?

I tried also forking a repo and trying to push a commit but I get this error:

To [email protected]:Lopicl/thunderkernel_cooperve.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:Lopicl/thunderkernel_cooperve.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

So I tried pulling the repo and:

Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution, or use 'git commit -a'.

Now I do not know what to do.


Solution

You have to commit or stash all your files before you can pull.

Below a simple way to add all files, commit them and push them to the master branch on the origin remote:

git add -A                          # Add all files to the index
git commit -m 'Your commit message' # Commit modifications
git pull origin master              # Get last changes (useless if you work on only one computer)
git push origin master              # Send changes


Answered By - aymericbeaumet
Answer Checked By - Marie Seifert (WPSolving Admin)