Skip to content

Commit e3a28b4

Browse files
committed
Merge pull request #4493 from mboersma/git-remote-exists-msg
fix(client): suggest help when git remote creation fails
2 parents ff221e4 + b8895ba commit e3a28b4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

client/cmd/apps.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ func AppCreate(id string, buildpack string, remote string, noRemote bool) error
4646
}
4747

4848
if !noRemote {
49-
return git.CreateRemote(c.ControllerURL.Host, remote, app.ID)
49+
if err = git.CreateRemote(c.ControllerURL.Host, remote, app.ID); err != nil {
50+
if err.Error() == "exit status 128" {
51+
fmt.Println("To replace the existing git remote entry, run:")
52+
fmt.Printf(" git remote rename deis deis.old && deis git:remote -a %s\n", app.ID)
53+
}
54+
return err
55+
}
5056
}
5157

5258
fmt.Println("remote available at", git.RemoteURL(c.ControllerURL.Host, app.ID))

0 commit comments

Comments
 (0)