Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub doesn't let me pull (nor push) my project #5596

Closed
Champol opened this issue Sep 11, 2018 · 8 comments
Closed

GitHub doesn't let me pull (nor push) my project #5596

Champol opened this issue Sep 11, 2018 · 8 comments

Comments

@Champol
Copy link

Champol commented Sep 11, 2018

We have been using GitHub desktop for years on a project. Days ago I pushed some updates, then my friend pushed hers. The next day I opened GitHub desktop to pull her commit, but the button for fetching said "Publish branch" instead. I tried in many ways to pull the repo into my pc, but none worked. When pressin Ctrl+Shirf+P, there is a little blink and nothing happens, not even a message.
When pressing "publish branch", an error message appears: "The repository has been updated since you last pulled. Try pulling before pushing.", but as I said, I can't pull the repo.
I don't have any idea on how to use the console to write commands, so I'm looking for a solution using only GitHub Desktop if possible.

@shiftkey
Copy link
Member

@Champol thanks for the report!

Could you attach the full log files? The Help | Show Logs in Explorer menu items should open the logs folder, and inside those are the log files generated by day. This will provide some more information to help troubleshoot.

@shiftkey shiftkey added the more-info-needed The submitter needs to provide more information about the issue label Sep 11, 2018
@Champol
Copy link
Author

Champol commented Sep 11, 2018

2018-09-08 was the day we last pushed our work, and everything was alright, but then, that day or the next I tried to pull and I couldn't.

2018-09-08.desktop.production.log
2018-09-09.desktop.production.log
2018-09-10.desktop.production.log

@shiftkey
Copy link
Member

@Champol thanks for the log files, they show that some Git operations are causing cascading failures.

09/09:

  • A fetch is unable to write to a specific location (multiple attempts, different problems)
2018-09-09T22:57:01.100Z - error: [ui] `git -c credential.helper= fetch --progress --prune origin` exited with an unexpected code: 128.
...
remote: Compressing objects: 100% (20/20), done.        
error: unable to write sha1 filename .git/objects/c9/5e8a368738fc17dabc328679139b2a61dc9d8f: Permission denied
fatal: failed to write object
fatal: unpack-objects failed
2018-09-09T23:07:30.119Z - error: [ui] `git -c credential.helper= fetch --progress --prune origin` exited with an unexpected code: 1.
error: cannot lock ref 'refs/remotes/origin/master': is at c95e8a368738fc17dabc328679139b2a61dc9d8f but expected 3610dc22af015e73d29ddbdc028f5e98b96bbb9c
From https://github.com/Champol/Dreamnesthesia
 ! 3610dc22..c95e8a36  master     -> origin/master  (unable to update local ref)
2018-09-09T23:07:06.017Z - error: [ui] `git -c credential.helper= fetch --progress --prune origin` exited with an unexpected code: 1.
... 
error: cannot lock ref 'refs/remotes/origin/master': Unable to create 'C:/Users/Juan Pablo/Champol/VG Dev/Proyectos GM/Dreamnesthesia/Dreamnesthesia/.git/refs/remotes/origin/master.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
From https://github.com/Champol/Dreamnesthesia
 ! 3610dc22..c95e8a36  master     -> origin/master  (unable to update local ref)
  • no push operations

10/09

  • fetch is still failing, with a broken origin/master ref now
2018-09-10T01:43:39.880Z - error: [ui] `git -c credential.helper= fetch --progress --prune origin` exited with an unexpected code: 1.
error: cannot lock ref 'refs/remotes/origin/master': unable to resolve reference 'refs/remotes/origin/master': reference broken
From https://github.com/Champol/Dreamnesthesia
 ! [new branch]        master     -> origin/master  (unable to update local ref)
  • trying to push is now failing because it doesn't know what origin/master actually is
2018-09-10T02:56:09.079Z - error: [ui] `git -c credential.helper= push origin master:master --progress` exited with an unexpected code: 1.
To https://github.com/Champol/Dreamnesthesia
 ! [rejected]          master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Champol/Dreamnesthesia'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  • our pull operation also checks for the origin/master ref and fails too
2018-09-10T03:28:41.053Z - error: [ui] `git merge-base master origin/master` exited with an unexpected code: 128.
warning: ignoring broken ref refs/remotes/origin/master.
fatal: Not a valid object name origin/master

That last error is one I can control (it blocks a pull from potentially getting the repository back into a known good state), but given fetch is also failing I don't think that alone will fix it.

What I'd recommend doing is removing and re-adding the remote so that it restores the origin/master ref that's causing the latest group of errors.

From a shell inside the problem repository, you should run these commands (but change [url] for the URL of the remote repository you are pushing/pulling changes from):

$ git remote rm origin
$ git remote add origin [url]
$ git fetch --all

Let me know if that gets you back to a good place!

@shiftkey shiftkey removed the more-info-needed The submitter needs to provide more information about the issue label Sep 12, 2018
@shiftkey shiftkey self-assigned this Sep 12, 2018
@Champol
Copy link
Author

Champol commented Sep 13, 2018

Thanks!
Sorry, I'm not very experienced in this: How do I create/open a shell? "Command Prompt"?
GitHub tells me I don't have git installed. Can I solve this without it or it is mandatory?
Thanks again

@Champol
Copy link
Author

Champol commented Sep 13, 2018

Followed your steps, didn't work =/

$ git fetch --all
Fetching origin
From https://github.com/Champol/Dreamnesthesia
 * [new branch]        branch2 -> origin/branch2
 * [new branch]        fmorales/main_menu -> origin/fmorales/main_menu
error: cannot lock ref 'refs/remotes/origin/master': unable to resolve reference 'refs/remotes/origin/master': reference broken
 ! [new branch]        master             -> origin/master  (unable to update local ref)
error: Could not fetch origin

@shiftkey shiftkey removed their assignment Sep 13, 2018
@shiftkey
Copy link
Member

@steveward any ideas?

@Champol
Copy link
Author

Champol commented Sep 13, 2018

Finally I did it manually: removed my local repo and cloned it again. Lost some changes but minimal.

@shiftkey
Copy link
Member

@Champol I'm glad you were able to workaround it. Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants