DEV Community

Discussion on: Using git to create a template project for repeated use

Collapse
 
mkrl profile image
Mikhail Korolev

Depends on what do you mean by a "base project".

If you want to have a certain file structure covered, just git init then init an application template with whatever your stack is (something like npm init).

Or have the folder/file tree ready somewhere else and wrap it into a shell alias cp -r /home/templates/stuff/* . (also a cool opportunity to extend it to the function that inits your base project depending on an argument).

If you want to have a blank project with a remote ready to go, you can also either use hub or create a new, let's say, GitHub repo with curl -u 'username' https://api.github.com/user/repos -d '{"name":"my repository name"}'. Github API can be very handy. Can also be wrapped in a function.

There is so much stuff!