Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hub create #1528

Closed
ShalokShalom opened this issue Aug 2, 2017 · 18 comments
Closed

hub create #1528

ShalokShalom opened this issue Aug 2, 2017 · 18 comments

Comments

@ShalokShalom
Copy link

ShalokShalom commented Aug 2, 2017

First, I dont get if this is a local or remote repo.

I can create a local with git as well, so I would not get the sense of hub create here.
If it's meant as a remote repo, this is what I get on git push:

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

Secondly, the command here seems to be hub create, not git create?

screenshot_20170802_132444

It's at least not working with git create here: git create is not a git command
While it is working with hub create.

Thanks a lot in advance

@ShalokShalom ShalokShalom changed the title Create a remote repo Create a locale/remote repo? Aug 2, 2017
@ShalokShalom ShalokShalom changed the title Create a locale/remote repo? hub create Aug 2, 2017
@ShalokShalom
Copy link
Author

ShalokShalom commented Aug 2, 2017

One more thing:

https://hub.github.com/hub.1.html

No ORGANIZATION/ here:
screenshot_20170802_142347

Then not here in the header, while part of the description:

screenshot_20170802_143003

And then finally here, in another syntax:

screenshot_20170802_142837

And not working in both cases:

screenshot_20170802_142554

@joshmorel
Copy link

There seems to be some misalignment between emphasising the hub command and aliasing hub with git in different documentation (ghpages vs manpages vs readme). I guess depending on what the maintainers are biasing users towards (using hub vs the aliased git) they should try to focus on... My preference would be hub with the option to alias.

I'm curious to hear what the maintainers say.

For the hub create command, assuming you have an existing git repository, you can do the following:

hub create -d "Test" # this creates the repo "hub" in your own users' namespace with description "Test"
hub create -d "Test" someorg/hub # this creates the repo "hub" in "someorgs" namespace, assuming you have the proper authorization

@ShalokShalom
Copy link
Author

The git create command doesnt work here currently. Does it for you?

@joshmorel
Copy link

Yes but I added this to my .bashrc file which aliases "git" with "hub" allowing git to initiate any git or hub command.

eval "$(hub alias -s)"

Instructions for aliasing are here: https://github.com/github/hub#aliasing

@ShalokShalom
Copy link
Author

Yeah fine. This change anything on the documentation?

@joshmorel
Copy link

It is covered in both README and ghpages site - but there are stylistic differences and perhaps ghpages is not explicit enough?

@mislav - do you think there is room for improvement in docs for being more explicit?

@mislav
Copy link
Owner

mislav commented Aug 8, 2017

This is the current documentation which you get with hub help create on the master branch (available as prereleases):

Usage: hub create [-poc] [-d <DESCRIPTION>] [-h <HOMEPAGE>] [[<ORGANIZATION>/]<NAME>]

Create a new repository on GitHub and add a git remote for it.

## Options:
        -p
                Create a private repository.

        -d <DESCRIPTION>
                Use this text as the description of the GitHub repository.

        -h <HOMEPAGE>
                Use this text as the URL of the GitHub repository.

        -o, --browse
                Open the new repository in a web browser.

        -c, --copy
                Put the URL of the new repository to clipboard instead of printing it.

        [<ORGANIZATION>/]<NAME>
                The name for the repository on GitHub (default: name of the current working
                directory).

                Optionally, create the repository within <ORGANIZATION>.

## Examples:
                $ hub create
                [ repo created on GitHub ]
                > git remote add -f origin git@github.com:USER/REPO.git

                $ hub create sinatra/recipes
                [ repo created in GitHub organization ]
                > git remote add -f origin git@github.com:sinatra/recipes.git

When the master branch is released, this will become the official documentation on the site.

Do you think this latest documentation is better?

  1. It suggests writing hub create instead of git create because it doesn't assume that hub was aliased as git;
  2. It clearly documents the ORGNAME/REPONAME syntax.

@ShalokShalom The correct syntax would be simply hub create KPC-quarantine-area/hub instead of pasting the whole URL. Is there anything else unclear?

@ShalokShalom
Copy link
Author

ShalokShalom commented Aug 8, 2017

Yeah, this is much more clear. Recognise, that the homepage still shows the old version.

And it still seems confusing to me, which USER/REPO get used, when hub create get triggered without any additional arguments.

@mislav
Copy link
Owner

mislav commented Aug 9, 2017

And it still seems confusing to me, which USER/REPO get used, when hub create get triggered without any additional arguments.

If you don't pass any arguments to hub create, the default USER/REPO will be:

  • USER: your username on GitHub ("ShalokShalom")
  • REPO: the name of the local project's directory (e.g. "myproject" when in "/path/to/myproject" directory).

@ShalokShalom
Copy link
Author

Then maybe mention that too.

From where knows hub that? Does it ask me for my login details, when i launch this command?

@mislav
Copy link
Owner

mislav commented Aug 10, 2017

Most (if not all) hub commands will ask for login details when first launched. This is not specific to hub create. Also, isn't it intuitive that a comamand whose description is "Create a repository on GitHub" would create one under your personal account by default?

@ShalokShalom
Copy link
Author

Yes.

@paulmelnikow
Copy link

Could hub create prompt you whether you want public or private? Or if that's too difficult, how about making hub create -p be the default, and letting the user make it public if they want to?

It's not obvious that it will be public by default. I'm using the fish completions, and there's no indication of that.

@ShalokShalom
Copy link
Author

Of course public by default.

@alphaCTzo7G
Copy link

I have multiple git alias such as `alias gac = "git add -A; git commit".

It seems there are 2 different methods suggested to alias hub to git:

  1. "alias git=hub" https://hub.github.com/

  2. eval "$(hub alias -s)"

What is the difference between the 2 methods..

Will my other git aliases work, if I use either of them? Which one is preferred and why?

@mislav
Copy link
Owner

mislav commented Apr 11, 2018

@alphaCTzo7G The 2nd one is preferred for long-term use by putting this in your ~/.bash_profile or similar shell initialization script. The 1st one is preferred for examples (such as on our site) where the alias is temporarily configured in the current shell so that git commands expanded by hub could be demonstrated.

Anyway, this issue is not the correct thread to discuss this, since the original thread was about hub create and not aliases.

@alphaCTzo7G
Copy link

makes sense.. thanks for the clarification.

@mislav
Copy link
Owner

mislav commented May 29, 2018

Closing since we clarified the behavior in this thread and the create docs in the master branch are vastly improved.

@mislav mislav closed this as completed May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants