diff --git a/pkg/cmd/repo/sync/sync.go b/pkg/cmd/repo/sync/sync.go index eebec4389..1f734b543 100644 --- a/pkg/cmd/repo/sync/sync.go +++ b/pkg/cmd/repo/sync/sync.go @@ -256,7 +256,7 @@ func executeLocalRepoSync(srcRepo ghrepo.Interface, remote string, opts *SyncOpt } if currentBranch == branch { if isDirty, err := git.IsDirty(); err == nil && isDirty { - return fmt.Errorf("can't sync because there are local changes; please stash them before trying again") + return fmt.Errorf("refusing to sync due to uncommitted/untracked local changes\ntip: use `git stash --all` before retrying the sync and run `git stash pop` afterwards") } else if err != nil { return err } diff --git a/pkg/cmd/repo/sync/sync_test.go b/pkg/cmd/repo/sync/sync_test.go index 9e7e5b5b1..90a216607 100644 --- a/pkg/cmd/repo/sync/sync_test.go +++ b/pkg/cmd/repo/sync/sync_test.go @@ -229,7 +229,7 @@ func Test_SyncRun(t *testing.T) { mgc.On("IsDirty").Return(true, nil).Once() }, wantErr: true, - errMsg: "can't sync because there are local changes; please stash them before trying again", + errMsg: "refusing to sync due to uncommitted/untracked local changes\ntip: use `git stash --all` before retrying the sync and run `git stash pop` afterwards", }, { name: "sync local repo with parent - existing branch, non-current",