if you're working on a development team that's making a lot of changes
to your code base and constantly submitting pull requests
at some point it'll be in your best interest to create a template to make sure that all your
requests have the same look and feel to them and in this video i'll show you how you can do that
so ultimately what we're going to do is add a folder and a new file to our
repository here for github to look at and to do this we'll go to our main branch you may call it
master the main core branch and we're going to add a file i'll select create new file we won't
put this at the root directory but instead we'll create a new folder called dot github add a slash
and it will automatically recognize this and the file we'll add is called pull underscore request
underscore template dot md it's going to be a markdown file and essentially what we put in
here will be the default that shows up in our pr template the next time we submit a request
so anything in here you can write out exactly as you would if you were writing anything in
a pull request the same markdown so you can say summary details and if you go to preview
you can see what this is going to look like so i'll go ahead and just add some comments here
maybe in italics you know obviously you can put whatever you want here i'm just adding and
you can see how the markdown will interpret it let's say you want to add some links references
you know whatever you wanted and it will interpret it that way
perhaps you want to add some check boxes for things that you want to make sure
that people check off on that they actually completed it you could do it something like this
had to open bracket space close the bracket and say something like tested changes or stakeholder
approval you know whatever you want and it would look like this so this is kind of nice
ultimately it's up to you and it doesn't really matter so let's go ahead and
commit this directly to our main branch added pr template commit
and here it is now if we go back to our main repo here we can see we now have this
so now to prove that this worked we'll create a new branch push up the changes and attempt to make
a pull request to see this come through so here i am in visual studio
i'll first do a git pull so i can get the latest so now here i can see i got that new file here
with the markdown and in the future you could now just edit this here directly and not have to do
it through the github ui you can you know add it here and have other people approve your changes
for now let's create a new branch so we'll do get checkout dash b for branch test pr template
get branch to confirm we're there to make a change we'll just adjust the readme to trigger
a change this is the repo for learning github there is a really great template in this repo
save and now we'll go through the process of git add git commit dash m
update readme
and now let's get push to push this change to github and now immediately we can see
they recognized it and let's compare and pull request and ideally we should see that template
immediately show up for us and here it is right away it fills this in for us all we have to do is
fill this out however we want you know we can if we want to add the check box there we can
you know put an x in there and and this will show up as
being checked so that's how you would fill that out
and you're ready to go
so from here on out anytime you or anybody else working with this project opens a pull request
it'll have the same look and feel which ultimately will make it a lot easier for people reviewing it
to understand what's going on and make the whole process of reviewing code much
easier
you