Create templates in Github
Tags: github
Published: 2021-02-17 02:06:42

### Hello my fellow programmers 
<br/>
Today I’m going to show you how to create a simple template on Github, it’s a nice feature and today I’ve already told some friends about it, to my surprise most of them don’t know it.
It's easy to create and you'll also save some time when creating a project that has a configuration that you always use.
Anyway, let's get start:

**Requirements**
- For this tutorial do you need at least have a Github account, if you dont have [click here](https://github.com/join?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&source=header-home) and create one :)
- Basic git knowlage
<br/>

1) Sign in on Github and in the top of the page click in the **+** button, and select **"New repository"**
![step1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/shrlje7oi7wnbpd2f407.png)

2) Name your repository in the **Name repository** input, the name must be unique.
After that click in the **Create repository**
![step2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z5v0u0ud2354kfufg48m.png)

3)Now the repository is alive, click in the gear icon for the repository **settings**, this is the most important part.
![step3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/seu2y6xikmmkbyobotql.png)

4)In the settings tab, mark the **template repository** checkbox, just that.
![step4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43afoyjsm08dmqtwn603.png)

5) Now we need to add some code for this repository can serve his purpose, I'll use sample node repository for it, but you can use whatever the project you want ^-^
![step5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/movo4v4b66mxittujk24.png)

Commit the code
![step6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzhr7cs3qtqn8w1vbj7f.png)
Add the remote repository link
![step7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ny7jzq3deiz6u22vckx4.png)
Push to the **main** or **master** branch
![step8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ncwu4qm62n0pt8nc8xcl.png)

6) Back in the github repository page, refresh and now we have some code, its time to use it. Click in the **Use this template** 
![step9](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ralykrfmqdhp67wxylnq.png)

7) The page for create a new repository is more simple, you can name the new repository and copy other branchs besides the main(or master) template repository.
The Github will create a  **brand new repository**, with the name you choose, all the code for the template, and if you select the option, all the branchs too.
![step10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uzzsurw7urcxttax5z8c.png)
<br/> 
#### Conclusion
Thats it, to use your new repository proceed as usual, clone, change, commit and this absolutely not affect your template repository.
<br/>
The sample template repository for this post [here](https://github.com/Kappyh/first-template)

Follow me on twitter [@kappyh](https://twitter.com/Kappyh)
[My github](https://github.com/Kappyh)

Thanks for the reading!  :smiley:

[**1 year free cloud and discounts**](https://cloud.atlantic.net/r/90vls777)

** Credits for the post cover**
[@perloov](https://unsplash.com/@perloov)