astropy / package-template

Template for packages that use Astropy. Maintainer: @astrofrog
http://docs.astropy.org/projects/package-template/en/latest/
Other
60 stars 63 forks source link

Create .git folder on render #479

Closed nstarman closed 1 year ago

nstarman commented 3 years ago

it would be nice to be able to import a repository into GitHub rather than create the repo and add the cookiecutter-generated contents. I think adding a .git folder with the bare minimum of files could accomplish this.

Screen Shot 2020-09-10 at 15 59 21
Cadair commented 3 years ago

We used to do this, but it was a bit of a pain. All you need to do is run git init after cookiecutter.

nstarman commented 3 years ago

Fair enough. I'm just looking at the large number of items I still do on project startup and hoping to automate them away. What specifically was the pain point? Could a post_gen_project hook make the folder afterwards? Or is git init preferable?

Screen Shot 2020-09-26 at 17 09 43

mwcraig commented 3 years ago

This is an interesting idea but I'm a little hesitant to impose the requirement that a .git folder be created. I could see that leading, in some edge cases, to unexpected behavior.

It might work as an option in the cookiecutter dialog to create a git repo by running git init post-generation, though I 'd argue for a default value of "no" for the option.

Cadair commented 3 years ago

here is an old version of the hook which used gitpython to init the repo and the old astropy_helpers submodule, hth :smile:

nstarman commented 3 years ago

Thanks for the suggestions. I like the idea of actually running git init rather than manually generating the file.

Cadair commented 3 years ago

yeah I wouldn't recommend manually generating it.

pllim commented 1 year ago

https://github.com/astropy/package-template#deprecation-warning