gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Git command exited with non-zero exit code

Open JoyHak opened this issue 8 months ago • 1 comments

Version

0.14.15

Operating System

Windows

Distribution Method

msi (Windows)

Describe the issue

After creating new PR I got git error: Image PR was successfully created and merged.

How to reproduce (Optional)

  1. Push "Submit for review"
  2. Fill new PR
  3. See error popup

Expected behavior (Optional)

  1. Push "Submit for review"
  2. Fill new PR
  3. Rebase and merge without errors.

Relevant log output (Optional)

2025-04-08T12:31:21.623295Z  INFO list_branches: crates\gitbutler-tauri\src\virtual_branches.rs:493: close time.busy=20.8ms time.idle=31.9µs project_id=414c02e1-fbdc-4021-b686-35b93458c777 filter=None
2025-04-08T12:31:29.040401Z ERROR push_stack: crates\gitbutler-tauri\src\stack.rs:113: error=Error(backend error: git command exited with non-zero exit code 1: ["push", "--quiet", "--no-verify", "origin", "b083f9e1a5b64f612cc34414708d957ea741ecb6:refs/heads/File-dialog"]

STDOUT:


STDERR:
To https://github.com/JoyHak/QuickSwitch
 ! [rejected]        b083f9e1a5b64f612cc34414708d957ea741ecb6 -> File-dialog (non-fast-forward)
error: failed to push some refs to 'https://github.com/JoyHak/QuickSwitch'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. If you want to integrate the remote changes, use 'git pull'
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Caused by:
    git command exited with non-zero exit code 1: ["push", "--quiet", "--no-verify", "origin", "b083f9e1a5b64f612cc34414708d957ea741ecb6:refs/heads/File-dialog"]
    
    STDOUT:
    
    
    STDERR:
    To https://github.com/JoyHak/QuickSwitch
     ! [rejected]        b083f9e1a5b64f612cc34414708d957ea741ecb6 -> File-dialog (non-fast-forward)
    error: failed to push some refs to 'https://github.com/JoyHak/QuickSwitch'
    hint: Updates were rejected because a pushed branch tip is behind its remote
    hint: counterpart. If you want to integrate the remote changes, use 'git pull'
    hint: before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.) project_id=414c02e1-fbdc-4021-b686-35b93458c777 stack_id=c9fca597-582d-48c1-9710-d867794b7d9c with_force=false
2025-04-08T12:31:29.040598Z  INFO push_stack: crates\gitbutler-tauri\src\stack.rs:113: close time.busy=11.6s time.idle=46.1µs project_id=414c02e1-fbdc-4021-b686-35b93458c777 stack_id=c9fca597-582d-48c1-9710-d867794b7d9c with_force=false
2025-04-08T12:31:29.054730Z  INFO stack_branches: crates\gitbutler-tauri\src\workspace.rs:44: new project_id=414c02e1-fbdc-4021-b686-35b93458c777 stack_id="c9fca597-582d-48c1-9710-d867794b7d9c"

JoyHak avatar Apr 08 '25 12:04 JoyHak

Thanks a lot for reporting!

I think this may be due to GitButler not realizing that a force-push is needed, so the subsequent push will fail.

Byron avatar Apr 08 '25 17:04 Byron