Skip to main content

Featured

SQL vs NoSQL.

SQL vs NoSQL.   By  Jeewantha Hiddalarachchi. In this tutorial, I going to discuss the difference between SQL and NoSQL databases. Let's start with a brief explanation about SQL and NoSQL. What is SQL? Structured Query language (SQL) is the standard language to communicate and deal with relational databases.  A relational database is a form of tables. Basically, we use SQL to insert, search, update and delete database records but it helps users to do lots of things like optimizing and maintenance of databases. SQL databases are table-based databases and there are vertically scalable. Not only that but also SQL has a predefined schema and always requires specialized DB hardware for better performance. Examples SQL databases -   MySQL  Microsoft SQL Server Oracle Sybase What is NoSQL? NoSQL is a non-relational Database Management System. And also NoSQL not like SQL because it does not require a fixed schema, avoids joins. It is mainly focused on scaling, fast queries, allowing for fr

Introduction to Git and GitHub (Part 03).

 Introduction to Git and GitHub (Part 03).

By Jeewantha Hiddalarachchi.

Step 9 - Create a pull request.

Pull Requests get a special place in version controlling and actually pull requests are the heart of collaboration on GitHub. When you open a pull request, you’re proposing your changes and requesting that someone review and pull in your contribution and merge them into their branch. Pull requests show diffs, or differences, of the content from both branches. The changes, additions, and subtractions are shown in green and red.

Before you should create two branches and add some files to them as you like. You can do use this blog and my previous git blog also. Remember your repositories that are willing to merge and pull wants should have some differences.

Therefore I change my devjeew branch repo content by using GitHub. Also, you can do the change by using your IDMs. You can see my changed branches below.


Master branch

devjeew branch
Let's know how to do a pull request.

When you visit your repository, you can see there is compare and pull request button to do pull request.


When you click that button, the system will redirect to the pull request page.


base/base branch is where changes should be applied, the head/head branch contains what you would like to be newly applied. In this blog, I arranged my head and base like this.

base => master
head => devjeew

when you click the create pull request button, the system shows the bellow page and makes you for merging codes.


Let's know how to merge pull requests by using GitHub.

Step 10 - Merge pull request.

From this merge pull request, we are going to merge our branches (master and devjeew branches).

On the merging page in Github, You have to ability to merge pull requests or close the pull request.

If you want to close the pull request, click on the close pull request button. Then system closes your pull request.


From this, you also can delete the branch. If you want to reopen your closed pull request you should click the Reopen pull request button. Then you can reopen your closed pull request.

If you want to merge your pull request, you should click on the green Merge pull request button.


When you click the merge pull request button, you want to confirm the merge. So you should click the confirm merge button.


When you clicked confirm merge button, then you can see your branches are successfully merged.


You can see your changes in which lines are added, removed modified like below.


You can see your changes in the master repository like below.

View of the master branch in GitHub.

Step 11 - Get the changed code on Github back to your computer.

Now you can see your repository on Github has some differences from what you have on your local repository on your local machine.

So, If you wish to continue your code implementation, you should get new changes in the Github repository to your local repository too.

To get the most recent changes that you or others have merged on Github, use git pull origin <Branch name> Command. (The branch that you want to pull changes from).

pull downloads remote changes to your local repository.

So I want to update my devjeew branch, then I use the below command.

$ git pull origin devjeew

These are the commits in devjeew before pulling changes from the Github repository.

Shows you all the files that have changed and how they’ve changed.

Now you can see all commits using git log command like below.


Summary.

Congratulations !. You cover all git command from this tutorial series. From this article, we discussed some of the useful commands for the pull request and merge using git and GitHub.  

Also, you can get all the above git commands from my GitHub gist.
Thank you very much for reading and I hope you have a better idea about this topic...😊.

Comments

Popular Posts