@@ -37,7 +37,7 @@ func init() {
3737 repoForkCmd .Flags ().Lookup ("remote" ).NoOptDefVal = "true"
3838
3939 repoCmd .AddCommand (repoViewCmd )
40- repoViewCmd .Flags ().BoolP ("web" , "w" , false , "Open repository in browser" )
40+ repoViewCmd .Flags ().BoolP ("web" , "w" , false , "Open a repository in the browser" )
4141}
4242
4343var repoCmd = & cobra.Command {
@@ -51,7 +51,7 @@ A repository can be supplied as an argument in any of the following formats:
5151}
5252
5353var repoCloneCmd = & cobra.Command {
54- Use : "clone <repo > [<directory>]" ,
54+ Use : "clone <repository > [<directory>]" ,
5555 Args : cobra .MinimumNArgs (1 ),
5656 Short : "Clone a repository locally" ,
5757 Long : `Clone a GitHub repository locally.
@@ -80,10 +80,12 @@ With no argument, creates a fork of the current repository. Otherwise, forks the
8080
8181var repoViewCmd = & cobra.Command {
8282 Use : "view [<repository>]" ,
83- Short : "View a repository in the browser " ,
84- Long : `View a GitHub repository.
83+ Short : "View a repository" ,
84+ Long : `Display the description and the README of a GitHub repository.
8585
86- With no argument, the repository for the current directory is displayed.` ,
86+ With no argument, the repository for the current directory is displayed.
87+
88+ With '--web', open the repository in a web browser instead.` ,
8789 RunE : repoView ,
8890}
8991
@@ -169,7 +171,7 @@ func addUpstreamRemote(parentRepo ghrepo.Interface, cloneDir string) error {
169171 // TODO: support SSH remote URLs
170172 upstreamURL := fmt .Sprintf ("https://github.com/%s.git" , ghrepo .FullName (parentRepo ))
171173
172- cloneCmd := git .GitCommand ("-C" , cloneDir , "remote" , "add" , "upstream" , upstreamURL )
174+ cloneCmd := git .GitCommand ("-C" , cloneDir , "remote" , "add" , "-f" , " upstream" , upstreamURL )
173175 cloneCmd .Stdout = os .Stdout
174176 cloneCmd .Stderr = os .Stderr
175177 return run .PrepareCmd (cloneCmd ).Run ()
0 commit comments