Hello there, students today will learn with you what a pull request is and how to create one after
we'll understand the definition of PR.
I will show you how you can create your first pool request.
We'll learn what is the difference between pool request and Richard Quest.
In this lesson, we are going to learn how we can match.
Coming from different branches will learn the difference between different methods and strategies.
I will show you how to add collaborator's to your repository.
You'll add me as a collaborator so that I will be able to evaluate your code.
First of all, let's understand what is a pull request pull request as a method of submitting contributions
to a project.
Imagine that you wrote a few days and implementing logic of discount calculation for your users.
And finally, you completed your work.
Now you need to match your card with the latest version of the source code.
Literally, you have to much of yours with comments that were done by other developers.
Why is this method is called a pull request.
You can pull changes from one branch to update another branch.
And by submitting a budget request, you ask other people to review your changes and pull them into
another branch.
Does it make sense now?
Now words to request make more sense.
And by the way, we'll request the terminology of the GitHub and mid-market repositories.
Yet Lab uses another term to describe the same process merge request.
The idea is pretty similar.
We may want to merge two branches and merge.
Request means that you want to ask somebody to merge the changes with the other branch.
Both requests and merge requests use get pull and get merge commands.
We are going to learn these commands in the next lessons, but don't confuse this terminology.
PR and Anmar refers to a much broader topic, and I believe you understand that both of these terms
describe the same process.
Now, when you understood that, let's proceed with our demo on the previous lesson remerged.
Our branch does a remote repository.
We add new file added discount calculation service.
Let's also change existing file for the sake of the demo.
Let me add spaces here in the Hello World File.
And I save this file now, I will add changes to the staging area and we'll make a commit the spaces
were added to the hello world file.
After I created the command, I pushed it to the remote ranch.
To create a pull request, you have to have two branches, and right now we have massive branch and
our task branch nice.
There are a lot of different ways to create a pull request.
Let me show you one of them.
Click on Pull Request tab here.
Now click on the new pull request button.
And here you have to specify which branch you want to pull into which branch.
In our case, Master is a main development branch dependent on the branch and strategy that you are
going to have at your work.
You might have development branches and development branch and Master Branch will be used only for releases.
In our particular case, we want to merge Task One branch into master.
That's why here I select a task one and here I have Master Branch.
Here you will see the difference between the state of these two branches.
Let's create a pull request.
Additionally, you may specify pull request description here on the right.
You can specify, pull, request, review and request.
Ehsani What is a defense review?
What is someone you want to review the code?
And this can be the person who is not necessarily responsible for merging branches, probably colleagues
of yours or software engineers from another development team.
But who needs to be aware of changes in your project?
On the other hand, think is someone who is responsible for emergencies, quote, this can be a tech
lead on your project or owner of the repository who is in charge of margin call to the master branch
later today.
I will show you how you can add me as an EHSANI right now, just click, reply, request button and
pull request is created on this tab.
You can see what commands you have on your branch.
On this type, you can see what files were changed in comparison with the branch where you want to major
changes.
We can see that there are two changes.
New file is created and the spaces are added to the hello world file.
Azanian reviewers will go over all your changes to investigate what exactly is changed in your pull
request.
Review process can leave commands here and the specific lines of code.
For example, why so many spaces here?
And the discussions have to be resolved, all my students who works with me offline assigned me to the
airport requests and during the offline lessons we reuseable request together and discuss with the group
what can be improved.
Let me also teach you how to admit to your request as an EHSANI.
I don't guarantee that I will be able to check each year request because for homework verification,
I use special type of tasks, coding exercises that verifies your homework automatically.
But you can learn at least how to read me here.
As I say, click the settings button next click manage access.
You might be asked to enter your password and I believe you understood that this is project specific
settings.
So in case you want to add collaborator's to your another project, you should open settings of that
exact repository.
Let's add me as a collaborator to your repository.
Press this green button, invite a collaborator.
You can find me using my nickname and repetoire.
I can't find myself because this is against the rules and this doesn't make sense.
But I can find one of my friends.
For example, let me find a friend of mine with the nickname Sweater Matko.
Similarly, you have to find my picture, click on it and press green button.
That is the rule of the GitHub.
Always press the green button.
Just joking.
I will not add Anri because I don't want to spam him because after I press green button and we should
receive request to become a collaborator in my repository and he also has to approve this request and
only after he approved the request, only after that you will be able to find him in.
You drop down for your pull request to navigate back to your open request.
You can open pull requests tab.
And here is our fresh PR.
I can procedure, I can and assign this request to myself.
OK, let's proceed.
As I mentioned, reviewers and Ehsani check your piara and once all discussions are resolved as an emergency
request by pressing this button, this March button has three methods.
They are great American.
Commit squash and merge rebase and merge.
Keeping the clean data repository is one of the top priority tasks for all contributors.
That clean the tree can save you a lot of time when trying to track down comments related to embark
or issue the default option, which is create a much.
It will take all comments from the PR and add them to the master brunch with a new it.
Let's take a look at this slide.
Imagine that there is a main branch we have in it.
Commit and commit one and two.
You created your feature branch and that branch we created commits three and four.
You prepared to request and now we select default option from merging comments and you see that you
can it will be created on the master branch, the commit that you will look like this merge some specific
branch.
That's it.
The result message is not very helpful when you will try to understand what this comment is about.
That's why this is not a recommended option by many developers.
We want to keep our gate historically and imagine the same case, but this time we would select the
second possible option, which is squash and match.
What is going to happen in this case, commence three and four will be added to the master branch.
What will happen is that Cummins will become blind and any other commit message can be added comit four
will be squashed into three and we will give any message we like with the help of GitHub interface and
what will happen in case I will opt for the search option.
Ribis and merge neurons are based in our commands are put on top of the master branch like you see on
this slide.
Come in three and four.
I just put on the top of the Master Branch.
Definitely attack.
It will choose strategies that you have to follow.
But my personal preference is rebase and match is not squash and much.
I believe if a developer wants to squash Kummetz, he or she has to do that locally in the local repository
before even pushing branch to the remote repository, but not ask us.
I need to squash your comments, but I also met tech leads that would prefer squash and match.
Rather than teach engineers how to write Canete messages and how to do squash later in this course,
I will show you how you can squash Kummetz.
Being a project owner, you can disable much methods that you don't like to do that, click on the settings
button and scroll page to the bottom, find merge button and uncheck methods that you don't need.
And if I would open my paper one more time, I can see that I have only one option available.
Let me select the third method and close my pull request.
Awesome.
Now, you can delete the task branch because it is not needed anymore in remote repository, since you
have already merged into the master branch and to not confuse anyone, let's remove it.
You can see that there is no task branch anymore in our remote repository.
Now our request is closed and we can check our current history of the master branch.
Make sure you are on the master branch and click here on Kummetz.
And we see that no other comments from Ergin were created on the committees that were created by us.
Great.
I believe now we can recap everything, what we have learned today in this lesson, we learned what
a pull request is and what is the difference between a pull request and a magic quest.
Together, we created a pull request.
I showed you how you can add collaborator's to the repository and we discussed what is the difference
between us any and reviewer and two requests.
Also today, we learned different management strategies and understood the difference between them.
That's all for now.
Thanks a lot for your attention and see you in the next lesson.