SlideShare a Scribd company logo
GIT PULL REQUEST
- Hitesh Kumar
▪ What is Pull request?
▪ Why do we need to create pull request?
▪ What is use of GIT branch?
▪ How to write code in Php? (only to make code readable)
▪ How to create Pull Request ?
▪ Adding line comments to a pull request
Key Points
What is pull
request?
A pull request is short for “requesting for a Git Pull”.
Pull requests let you tell others about changes you've pushed to a branch
in a repository on GitHub. Once a pull request is opened, you can discuss
and review the potential changes and add follow-up commits before your
changes are merged into the base branch.
This can be confusing to understand, so we’re going to explain it with an
analogy.
Imagine you have a crate of bananas that you want to load onto a ship. The
only way to load the bananas is:
1. You get someone to throw down a rope
2. You tie the rope to the crate
3. They pull the crate up
When they pull the crate up, they’ll want to check whether your bananas are
good. If they spot a rotten banana, they might want to request you change
that rotten banana for a good one.
They might also think that all your bananas suck and decide to
throw them away. (But let’s hope this doesn’t happen, shall we?)
In this analogy, the crate of bananas is your code from the develop
branch. The ship is the master branch. The sailor is here to check
whether your code is good enough for the master branch.
That’s what a pull request is: You get someone to check your code
before merging into another branch.
The only difference between our analogy we used and an actual
pull-request is: You don’t ask someone to throw a rope down for
you. You bring the rope yourself, you tie it to your bananas at the
harbour, and you throw it onto the ship. The only thing the sailor
needs to do is check the bananas.
This is what we mean by submitting a pull request.
Why do we need to
create pull request?
A Pull Request represents a way to deliver value to the application in the form
of a set of changes that together form a high-level concern
A Pull Request is not just a way to "prepare" a set of commits so that it can be sent
to the owner of another copy of the project through external means (such as e-
mail). A Pull Request is the set of commits, that also contains the technical
history of everything that was related to that Pull Request. All in a single place.
What is use of GIT
branch?
In very simple terms, git branches are individual projects within a git
repository. Different branches within a repository can have completely
different files and folders, or it could have everything the same except
for some lines of code in a file.
Let’s use a few real world examples (at least that I’ve used before, others may have used them
differently):
● Pretend you submitted a research article to a journal and they want you to revise it based on some
reviewers comments. There are several ways to deal with the comments, so instead of changing your main
manuscript, you create a revision branch in your manuscript git repository. In that branch you make the
changes to your manuscript in response to the reviewers. Once you are satisfied, you merge the branch
into the master branch and resubmit the article.
● Imagine you have a dataset that multiple people work off of but that is also often updated with more data.
You think you found a problem with the dataset, but aren’t sure. So you create a new branch fixing to fix
the problems without messing with the master dataset. After you confirm the problem is real and that you
have the solution, you submit a pull request of the fixing branch to be merged with the master branch.
● What is often the case in software development, a bug or missing feature in the software gets identified.
Because the software is already in production use (fairly stable, other people rely on it, etc), you can’t just
make changes to the main software code. So a hotfix or feature branch is created to address these
problems, which will eventually get merged in with the master branch for the next version of the software.
This ensures that other people’s code isn’t broken everytime a bug gets fixed.
COMMANDS USED WITH BRANCHES
Branches are best understood visually. So let’s first start with using this website to see what the branch, checkout, and
merge commands are doing.
After we’ve tried that, let’s do it locally (on your own computer). Here is a sequence of commands to try out:
● cd - change directory
● directory - the same thing as a folder
● mkdir - make a directory
● echo - print a message to the screen or to a file if > (redirect) is present.
● git init - start or initialize a git repository
● git add - put a file into the staging area, so that git starts tracking it
● git commit - send files in the staging/index area into the history (the git repository)
● git log --graph --oneline --decorate --all - view the commit history in the git repository and the
branches, with each commit as one line.
● git branch - An individual line of commit history that contains files that may differ from other branches.
● git checkout - A way to move across the git commits and branches.
● git merge - Combine a branch into the current checked out branch (i.e. the branch you are on).
USING BRANCHES FOR PULL REQUESTS
I mentioned this already, but branches are best used when doing a pull request (unless the pull request is very small or few
people work on the repository).
The steps to take would be:
1. Fork a repository on GitHub
2. Clone it onto your computer
3. Make a branch and move to it: git checkout -b fixingBranch
4. Make changes to the files
5. Commit the changes to the history
6. Push the branch up to your forked version: git push origin fixingBranch
7. On GitHub, submit a Pull Request of your fixingBranch
8. Once the pull request is merged, delete the fixingBranch on your forked repo on GitHub and on your
computer (git checkout master && git pull upstream master && git branch -d fixingBranch)
How to write code
in Php?
Only to make code readable not about logic
How to create Pull
Request ?
Before we submit a pull request, we need to make some changes, so we have
something to merge. In this case, we’re going to add a heading to the code:
You need to commit this code into the develop branch. Then, you need to push
it to the git remote.
f It’ll appear in the section I highlighted in the image below.
If you see the message, great. Click on it. You’ll save a few steps.
If you don’t see it, you can click on the pull request tab at the top of your Github
repo.
Then, click on the green button that says “new pull request”.
You’ll come to a page that says “Compare changes”.
To create a pull request, you want to set the base and compare branches to the
following:
● base: branch you want to merge to
● compare: branch you want to merge from
In our case, we want to merge to master, so we’ll set base to master. We’re
merging from develop, so we’ll set compare to develop.
Once you’ve selected your branches, Github will show you the list of commits that
have been made. Here’ what you need to do is click on the “Create pull request
button”.
Github will show you a page that says “Open a pull request”.
Note: This is the page you’ll arrive at if you saw the “Your branch has been updated
X minutes ago” message I talked about earlier.
The title you write will be the title people see in the pull request tab. We’re
going to set it to “Add a heading to the index”.
For the comments, it’s going to be the first message people see when they
clicked into the pull request. In this case, we’ll say “I’ve added a heading. Let
me know if its good?”.
Once you’ve added the title and message, you can click on the Create pull
request button at the bottom of the page.
Now, if you click on the pull request tab at the top, you’ll an open pull request
that we’ve just submitted.
This is how you create a pull request
Adding line
comments to a pull
request
Visit the below link to add the line comment in changed files.
https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-
request
Thank You

More Related Content

What's hot

Git hub party-20151008
Git hub party-20151008Git hub party-20151008
Git hub party-20151008
Blanca Mancilla
 
Basics of Open Source Contribution - WWCodeMobile
Basics of Open Source Contribution - WWCodeMobileBasics of Open Source Contribution - WWCodeMobile
Basics of Open Source Contribution - WWCodeMobile
Vui Nguyen
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
Evan Lin
 
WordCamp SF 2014 - WIRED Migration Project
WordCamp SF 2014 - WIRED Migration ProjectWordCamp SF 2014 - WIRED Migration Project
WordCamp SF 2014 - WIRED Migration Project
kvignos
 
Bitbucket
BitbucketBitbucket
Bitbucket
hariprasad1035
 
A Git MVP Workflow
A Git MVP WorkflowA Git MVP Workflow
A Git MVP Workflow
Burt Lum
 
Introduction to Github for Team Project
Introduction to Github for Team ProjectIntroduction to Github for Team Project
Introduction to Github for Team Project
Akhter Al Amin
 
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
Luca Milanesio
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
"FENG "GEORGE"" YU
 
Git basic
Git basicGit basic
Git basic
Emran Ul Hadi
 
GitHub Integration for Orangescrum Cloud Released!
GitHub Integration for Orangescrum Cloud Released!GitHub Integration for Orangescrum Cloud Released!
GitHub Integration for Orangescrum Cloud Released!
Orangescrum
 
Bootstrapping your plugin
Bootstrapping your pluginBootstrapping your plugin
Bootstrapping your plugin
Marko Heijnen
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ Git
heyMP
 
Git basics
Git basicsGit basics
Git basics
Padmavathi Tiwari
 
DevNet 1056 WIT Spark API and Chat Bot Workshop
DevNet 1056 WIT Spark API and Chat Bot WorkshopDevNet 1056 WIT Spark API and Chat Bot Workshop
DevNet 1056 WIT Spark API and Chat Bot Workshop
Tessa Mero
 
Learn reactjs, how to code with example and general understanding thinkwik
Learn reactjs, how to code with example and general understanding   thinkwikLearn reactjs, how to code with example and general understanding   thinkwik
Learn reactjs, how to code with example and general understanding thinkwik
Hetaxi patel
 
Chatbots
ChatbotsChatbots
Chatbots
Tessa Mero
 
Building plugins like a pro
Building plugins like a proBuilding plugins like a pro
Building plugins like a pro
Marko Heijnen
 
Building Chatbots
Building ChatbotsBuilding Chatbots
Building Chatbots
Tessa Mero
 
Angular vs. React
Angular vs. ReactAngular vs. React
Angular vs. React
OPITZ CONSULTING Deutschland
 

What's hot (20)

Git hub party-20151008
Git hub party-20151008Git hub party-20151008
Git hub party-20151008
 
Basics of Open Source Contribution - WWCodeMobile
Basics of Open Source Contribution - WWCodeMobileBasics of Open Source Contribution - WWCodeMobile
Basics of Open Source Contribution - WWCodeMobile
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
 
WordCamp SF 2014 - WIRED Migration Project
WordCamp SF 2014 - WIRED Migration ProjectWordCamp SF 2014 - WIRED Migration Project
WordCamp SF 2014 - WIRED Migration Project
 
Bitbucket
BitbucketBitbucket
Bitbucket
 
A Git MVP Workflow
A Git MVP WorkflowA Git MVP Workflow
A Git MVP Workflow
 
Introduction to Github for Team Project
Introduction to Github for Team ProjectIntroduction to Github for Team Project
Introduction to Github for Team Project
 
Stable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code ReviewStable master workflow with Gerrit Code Review
Stable master workflow with Gerrit Code Review
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Git basic
Git basicGit basic
Git basic
 
GitHub Integration for Orangescrum Cloud Released!
GitHub Integration for Orangescrum Cloud Released!GitHub Integration for Orangescrum Cloud Released!
GitHub Integration for Orangescrum Cloud Released!
 
Bootstrapping your plugin
Bootstrapping your pluginBootstrapping your plugin
Bootstrapping your plugin
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ Git
 
Git basics
Git basicsGit basics
Git basics
 
DevNet 1056 WIT Spark API and Chat Bot Workshop
DevNet 1056 WIT Spark API and Chat Bot WorkshopDevNet 1056 WIT Spark API and Chat Bot Workshop
DevNet 1056 WIT Spark API and Chat Bot Workshop
 
Learn reactjs, how to code with example and general understanding thinkwik
Learn reactjs, how to code with example and general understanding   thinkwikLearn reactjs, how to code with example and general understanding   thinkwik
Learn reactjs, how to code with example and general understanding thinkwik
 
Chatbots
ChatbotsChatbots
Chatbots
 
Building plugins like a pro
Building plugins like a proBuilding plugins like a pro
Building plugins like a pro
 
Building Chatbots
Building ChatbotsBuilding Chatbots
Building Chatbots
 
Angular vs. React
Angular vs. ReactAngular vs. React
Angular vs. React
 

Similar to Technical Seminar Series: GIT Pull Requests Best Practices

Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
Tilton2
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
RaghavendraVattikuti1
 
Git Tutorials Git vs GitHub.pptx
Git Tutorials Git vs GitHub.pptxGit Tutorials Git vs GitHub.pptx
Git Tutorials Git vs GitHub.pptx
DevOps University
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko
 
E caregitpresentation
E caregitpresentationE caregitpresentation
E caregitpresentation
Rakesh Kumar Shardiwal
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
AliaaTarek5
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
DSCVSSUT
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
Himanshu Agrawal
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
聖文 鄭
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
Otto Kekäläinen
 
Git & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbourneGit & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon Melbourne
Paal Ringstad
 
OpenStack Contribution Process
OpenStack Contribution ProcessOpenStack Contribution Process
OpenStack Contribution Process
openstackindia
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution process
Syed Armani
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
BeckhamWee
 
Get your Git on GitHub
Get your Git on GitHubGet your Git on GitHub
Get your Git on GitHub
Runcy Oommen
 
DevOps Workshop Part 1
DevOps Workshop Part 1DevOps Workshop Part 1
DevOps Workshop Part 1
GDSC UofT Mississauga
 
devops-complete-notes-2.pdf
devops-complete-notes-2.pdfdevops-complete-notes-2.pdf
devops-complete-notes-2.pdf
RobinRohit2
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon Melbourne
Paal Ringstad
 
Contributing to Upstream Open Source Projects
Contributing to Upstream Open Source ProjectsContributing to Upstream Open Source Projects
Contributing to Upstream Open Source Projects
Scott Garman
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
Chen-Tien Tsai
 

Similar to Technical Seminar Series: GIT Pull Requests Best Practices (20)

Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Git Tutorials Git vs GitHub.pptx
Git Tutorials Git vs GitHub.pptxGit Tutorials Git vs GitHub.pptx
Git Tutorials Git vs GitHub.pptx
 
Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015Nina Zakharenko - Introduction to Git - Start SLC 2015
Nina Zakharenko - Introduction to Git - Start SLC 2015
 
E caregitpresentation
E caregitpresentationE caregitpresentation
E caregitpresentation
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdf
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
 
Git & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbourneGit & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon Melbourne
 
OpenStack Contribution Process
OpenStack Contribution ProcessOpenStack Contribution Process
OpenStack Contribution Process
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution process
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git Workshop
 
Get your Git on GitHub
Get your Git on GitHubGet your Git on GitHub
Get your Git on GitHub
 
DevOps Workshop Part 1
DevOps Workshop Part 1DevOps Workshop Part 1
DevOps Workshop Part 1
 
devops-complete-notes-2.pdf
devops-complete-notes-2.pdfdevops-complete-notes-2.pdf
devops-complete-notes-2.pdf
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon Melbourne
 
Contributing to Upstream Open Source Projects
Contributing to Upstream Open Source ProjectsContributing to Upstream Open Source Projects
Contributing to Upstream Open Source Projects
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 

More from Singsys Pte Ltd

Laravel Security Standards
Laravel Security Standards Laravel Security Standards
Laravel Security Standards
Singsys Pte Ltd
 
Android OS - The Journey of most popular Operating System
Android OS - The Journey of most popular Operating SystemAndroid OS - The Journey of most popular Operating System
Android OS - The Journey of most popular Operating System
Singsys Pte Ltd
 
How to do Memory Optimizations in Android
How to do Memory Optimizations in AndroidHow to do Memory Optimizations in Android
How to do Memory Optimizations in Android
Singsys Pte Ltd
 
iOS Application Battery Optimization Techniques
iOS Application Battery Optimization TechniquesiOS Application Battery Optimization Techniques
iOS Application Battery Optimization Techniques
Singsys Pte Ltd
 
Android Battery optimization Android Apps
Android Battery optimization Android AppsAndroid Battery optimization Android Apps
Android Battery optimization Android Apps
Singsys Pte Ltd
 
How to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsHow to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy Steps
Singsys Pte Ltd
 
Basics of-linux
Basics of-linuxBasics of-linux
Basics of-linux
Singsys Pte Ltd
 
SoLoMo
SoLoMoSoLoMo
Introduction to facebook sdk
Introduction to facebook sdkIntroduction to facebook sdk
Introduction to facebook sdk
Singsys Pte Ltd
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
Singsys Pte Ltd
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
Singsys Pte Ltd
 
Joomla 3 installation and management guide
Joomla 3 installation and management guideJoomla 3 installation and management guide
Joomla 3 installation and management guide
Singsys Pte Ltd
 
Joomla Introduction & Installation Tutorial
Joomla Introduction & Installation TutorialJoomla Introduction & Installation Tutorial
Joomla Introduction & Installation Tutorial
Singsys Pte Ltd
 
Basic of web design
Basic of web designBasic of web design
Basic of web design
Singsys Pte Ltd
 
Embedded Technology
Embedded TechnologyEmbedded Technology
Embedded Technology
Singsys Pte Ltd
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
Singsys Pte Ltd
 
Technical seo tips for web developers
Technical seo tips for web developersTechnical seo tips for web developers
Technical seo tips for web developers
Singsys Pte Ltd
 
WordPress Website Design and Development
WordPress Website Design and DevelopmentWordPress Website Design and Development
WordPress Website Design and Development
Singsys Pte Ltd
 
Being a designer
Being a designerBeing a designer
Being a designer
Singsys Pte Ltd
 
Points for Design and Development of SEO friendly websites
Points for Design and Development of SEO friendly websitesPoints for Design and Development of SEO friendly websites
Points for Design and Development of SEO friendly websites
Singsys Pte Ltd
 

More from Singsys Pte Ltd (20)

Laravel Security Standards
Laravel Security Standards Laravel Security Standards
Laravel Security Standards
 
Android OS - The Journey of most popular Operating System
Android OS - The Journey of most popular Operating SystemAndroid OS - The Journey of most popular Operating System
Android OS - The Journey of most popular Operating System
 
How to do Memory Optimizations in Android
How to do Memory Optimizations in AndroidHow to do Memory Optimizations in Android
How to do Memory Optimizations in Android
 
iOS Application Battery Optimization Techniques
iOS Application Battery Optimization TechniquesiOS Application Battery Optimization Techniques
iOS Application Battery Optimization Techniques
 
Android Battery optimization Android Apps
Android Battery optimization Android AppsAndroid Battery optimization Android Apps
Android Battery optimization Android Apps
 
How to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsHow to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy Steps
 
Basics of-linux
Basics of-linuxBasics of-linux
Basics of-linux
 
SoLoMo
SoLoMoSoLoMo
SoLoMo
 
Introduction to facebook sdk
Introduction to facebook sdkIntroduction to facebook sdk
Introduction to facebook sdk
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Joomla 3 installation and management guide
Joomla 3 installation and management guideJoomla 3 installation and management guide
Joomla 3 installation and management guide
 
Joomla Introduction & Installation Tutorial
Joomla Introduction & Installation TutorialJoomla Introduction & Installation Tutorial
Joomla Introduction & Installation Tutorial
 
Basic of web design
Basic of web designBasic of web design
Basic of web design
 
Embedded Technology
Embedded TechnologyEmbedded Technology
Embedded Technology
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Technical seo tips for web developers
Technical seo tips for web developersTechnical seo tips for web developers
Technical seo tips for web developers
 
WordPress Website Design and Development
WordPress Website Design and DevelopmentWordPress Website Design and Development
WordPress Website Design and Development
 
Being a designer
Being a designerBeing a designer
Being a designer
 
Points for Design and Development of SEO friendly websites
Points for Design and Development of SEO friendly websitesPoints for Design and Development of SEO friendly websites
Points for Design and Development of SEO friendly websites
 

Recently uploaded

Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

Technical Seminar Series: GIT Pull Requests Best Practices

  • 1. GIT PULL REQUEST - Hitesh Kumar
  • 2. ▪ What is Pull request? ▪ Why do we need to create pull request? ▪ What is use of GIT branch? ▪ How to write code in Php? (only to make code readable) ▪ How to create Pull Request ? ▪ Adding line comments to a pull request Key Points
  • 3. What is pull request? A pull request is short for “requesting for a Git Pull”. Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes and add follow-up commits before your changes are merged into the base branch.
  • 4. This can be confusing to understand, so we’re going to explain it with an analogy. Imagine you have a crate of bananas that you want to load onto a ship. The only way to load the bananas is: 1. You get someone to throw down a rope 2. You tie the rope to the crate 3. They pull the crate up When they pull the crate up, they’ll want to check whether your bananas are good. If they spot a rotten banana, they might want to request you change that rotten banana for a good one.
  • 5. They might also think that all your bananas suck and decide to throw them away. (But let’s hope this doesn’t happen, shall we?) In this analogy, the crate of bananas is your code from the develop branch. The ship is the master branch. The sailor is here to check whether your code is good enough for the master branch. That’s what a pull request is: You get someone to check your code before merging into another branch. The only difference between our analogy we used and an actual pull-request is: You don’t ask someone to throw a rope down for you. You bring the rope yourself, you tie it to your bananas at the harbour, and you throw it onto the ship. The only thing the sailor needs to do is check the bananas. This is what we mean by submitting a pull request.
  • 6. Why do we need to create pull request? A Pull Request represents a way to deliver value to the application in the form of a set of changes that together form a high-level concern
  • 7. A Pull Request is not just a way to "prepare" a set of commits so that it can be sent to the owner of another copy of the project through external means (such as e- mail). A Pull Request is the set of commits, that also contains the technical history of everything that was related to that Pull Request. All in a single place.
  • 8. What is use of GIT branch? In very simple terms, git branches are individual projects within a git repository. Different branches within a repository can have completely different files and folders, or it could have everything the same except for some lines of code in a file.
  • 9. Let’s use a few real world examples (at least that I’ve used before, others may have used them differently): ● Pretend you submitted a research article to a journal and they want you to revise it based on some reviewers comments. There are several ways to deal with the comments, so instead of changing your main manuscript, you create a revision branch in your manuscript git repository. In that branch you make the changes to your manuscript in response to the reviewers. Once you are satisfied, you merge the branch into the master branch and resubmit the article. ● Imagine you have a dataset that multiple people work off of but that is also often updated with more data. You think you found a problem with the dataset, but aren’t sure. So you create a new branch fixing to fix the problems without messing with the master dataset. After you confirm the problem is real and that you have the solution, you submit a pull request of the fixing branch to be merged with the master branch. ● What is often the case in software development, a bug or missing feature in the software gets identified. Because the software is already in production use (fairly stable, other people rely on it, etc), you can’t just make changes to the main software code. So a hotfix or feature branch is created to address these problems, which will eventually get merged in with the master branch for the next version of the software. This ensures that other people’s code isn’t broken everytime a bug gets fixed.
  • 10. COMMANDS USED WITH BRANCHES Branches are best understood visually. So let’s first start with using this website to see what the branch, checkout, and merge commands are doing. After we’ve tried that, let’s do it locally (on your own computer). Here is a sequence of commands to try out: ● cd - change directory ● directory - the same thing as a folder ● mkdir - make a directory ● echo - print a message to the screen or to a file if > (redirect) is present. ● git init - start or initialize a git repository ● git add - put a file into the staging area, so that git starts tracking it ● git commit - send files in the staging/index area into the history (the git repository) ● git log --graph --oneline --decorate --all - view the commit history in the git repository and the branches, with each commit as one line. ● git branch - An individual line of commit history that contains files that may differ from other branches. ● git checkout - A way to move across the git commits and branches. ● git merge - Combine a branch into the current checked out branch (i.e. the branch you are on).
  • 11. USING BRANCHES FOR PULL REQUESTS I mentioned this already, but branches are best used when doing a pull request (unless the pull request is very small or few people work on the repository). The steps to take would be: 1. Fork a repository on GitHub 2. Clone it onto your computer 3. Make a branch and move to it: git checkout -b fixingBranch 4. Make changes to the files 5. Commit the changes to the history 6. Push the branch up to your forked version: git push origin fixingBranch 7. On GitHub, submit a Pull Request of your fixingBranch 8. Once the pull request is merged, delete the fixingBranch on your forked repo on GitHub and on your computer (git checkout master && git pull upstream master && git branch -d fixingBranch)
  • 12. How to write code in Php? Only to make code readable not about logic
  • 13.
  • 14. How to create Pull Request ?
  • 15. Before we submit a pull request, we need to make some changes, so we have something to merge. In this case, we’re going to add a heading to the code: You need to commit this code into the develop branch. Then, you need to push it to the git remote. f It’ll appear in the section I highlighted in the image below. If you see the message, great. Click on it. You’ll save a few steps. If you don’t see it, you can click on the pull request tab at the top of your Github repo.
  • 16. Then, click on the green button that says “new pull request”.
  • 17. You’ll come to a page that says “Compare changes”. To create a pull request, you want to set the base and compare branches to the following: ● base: branch you want to merge to ● compare: branch you want to merge from In our case, we want to merge to master, so we’ll set base to master. We’re merging from develop, so we’ll set compare to develop. Once you’ve selected your branches, Github will show you the list of commits that have been made. Here’ what you need to do is click on the “Create pull request button”.
  • 18. Github will show you a page that says “Open a pull request”. Note: This is the page you’ll arrive at if you saw the “Your branch has been updated X minutes ago” message I talked about earlier.
  • 19.
  • 20. The title you write will be the title people see in the pull request tab. We’re going to set it to “Add a heading to the index”. For the comments, it’s going to be the first message people see when they clicked into the pull request. In this case, we’ll say “I’ve added a heading. Let me know if its good?”.
  • 21. Once you’ve added the title and message, you can click on the Create pull request button at the bottom of the page. Now, if you click on the pull request tab at the top, you’ll an open pull request that we’ve just submitted. This is how you create a pull request
  • 22. Adding line comments to a pull request
  • 23. Visit the below link to add the line comment in changed files. https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull- request