Skip to content

Repo create tweaks#2991

Merged
mislav merged 3 commits intotrunkfrom
repo-create-prompt-change
Mar 2, 2021
Merged

Repo create tweaks#2991
mislav merged 3 commits intotrunkfrom
repo-create-prompt-change

Conversation

@mislav
Copy link
Contributor

@mislav mislav commented Feb 17, 2021

In local git directory:
1. `This will add an "origin" git remote to your local repository.  Continue?`
2. "origin" git remote is added in current directory.

Outside of a local git directory:
1. This will create the "REPO" repository on GitHub. Continue?
2. `Create a local project directory for "REPO"?`
3. new directory called "REPO" now set up for the GitHub repository.
Fixes a problem where setting up a new local directory for the
repository created from a template would not contain any files:

    gh repo create -p OWNER/some-template my-repo --private --confirm
    ls my-repo
    //=> [empty directory]

Fixes #2290
Copy link
Contributor

@vilmibm vilmibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A+ but waiting for tests

@mislav mislav requested a review from vilmibm March 1, 2021 13:13
@mislav
Copy link
Contributor Author

mislav commented Mar 1, 2021

Added tests for creating from template scenario. Basically, it works like this:

gh repo create myrepo --template owner/repo -y --private
#=> git init myrepo; cd myrepo
#=> git remote add origin ...
#=> git fetch origin <main-branch>
#=> git checkout <main-branch>

@mislav mislav merged commit 07e6d60 into trunk Mar 2, 2021
@mislav mislav deleted the repo-create-prompt-change branch March 2, 2021 14:16
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

Successfully merging this pull request may close these issues.

"gh repo create --template" creates an empty repository locally

2 participants