Unclear error message when remote rejects push
See original GitHub issueDescription
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
- 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 - Checkout
master
, make any change, commit it, and try to push - Here is the error message you get :
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:
- Created 6 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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 bumpdugite
in Desktop.