question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unclear error message when remote rejects push

See original GitHub issue

Description

GitHub Desktop gives the whole git log when trying to push to a protected branch, instead of simply telling the user that it is not possible to push to that protected branch.

This issue may be related to #858

Version

GitHub Desktop version: 1.0.4

OS version: Windows 10

Steps to Reproduce

  1. Use a repository where one of the branches is protected, for example master. You must be the owner of the repo, and enforce protection for the administrators as well
  2. Checkout master, make any change, commit it, and try to push
  3. Here is the error message you get :

image

Expected behavior: A better error message, at least without all the git log when it was trying to push

Actual behavior: Well, here is the screenshot ^^

Reproduces how often: Always

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
shiftkeycommented, Oct 17, 2017

It looks like it’s not being caught by our existing error handling. The work to do this is done here:

https://github.com/desktop/desktop/blob/8824fc0ca27e146ffa4fd7365c112d25221614a7/app/src/lib/git/core.ts#L180-L182

@agisilaos these error codes live in dugite - we map specific error messages to these codes in the library. Here’s the PR where we added a bunch of these messages, if you want to dig into that: https://github.com/desktop/dugite/pull/76.

@Raul6469 could you attach the raw output so can incorporate that into tests? It should be in the logs: Help | Show logs in Explorer.

1reaction
shiftkeycommented, Oct 30, 2017

I’ve been getting some fixes into dugite today - this has been added to https://github.com/desktop/dugite/pull/143 and will be fixed when I bump dugite in Desktop.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git push error '[remote rejected] master - Stack Overflow
The error message error: refusing to update checked out branch: refs/heads/master is emitted by the remote repository and it means you're trying to...
Read more >
Remote rejected main -> main (unpacker error) - GitLab Forum
I would say to check if your new repo is really empty, and try push in force mode. But this error make me...
Read more >
Error with unclear next steps from `git push` to hosted repository
Error with unclear next steps from `git push` to hosted repository. Open, Needs TriagePublic ... [remote rejected] master -> master (n/a (unpacker error))...
Read more >
Git's rejected push error - The Universe of Discourse
Git's rejected push error. On Saturday I posted an article explaining how remote branches and remote-tracking branches work in Git.
Read more >
How to Fix 'failed to push some refs to' Git Errors - Komodor
A commit gets rejected and causes a failed to push some refs to error because the remote branch contains code that you do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found