SlideShare ist ein Scribd-Unternehmen logo
1 von 24
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

Weitere ähnliche Inhalte

Was ist angesagt?

Basics of Open Source Contribution - WWCodeMobile
Basics of Open Source Contribution - WWCodeMobileBasics of Open Source Contribution - WWCodeMobile
Basics of Open Source Contribution - WWCodeMobileVui Nguyen
 
COSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangCOSCUP 2016: Project 52 每週一個小專案來學習 Golang
COSCUP 2016: Project 52 每週一個小專案來學習 GolangEvan Lin
 
WordCamp SF 2014 - WIRED Migration Project
WordCamp SF 2014 - WIRED Migration ProjectWordCamp SF 2014 - WIRED Migration Project
WordCamp SF 2014 - WIRED Migration Projectkvignos
 
A Git MVP Workflow
A Git MVP WorkflowA Git MVP Workflow
A Git MVP WorkflowBurt Lum
 
Introduction to Github for Team Project
Introduction to Github for Team ProjectIntroduction to Github for Team Project
Introduction to Github for Team ProjectAkhter 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 ReviewLuca Milanesio
 
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 pluginMarko Heijnen
 
Git Going w/ Git
Git Going w/ GitGit Going w/ Git
Git Going w/ GitheyMP
 
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 WorkshopTessa 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 thinkwikHetaxi patel
 
Building plugins like a pro
Building plugins like a proBuilding plugins like a pro
Building plugins like a proMarko Heijnen
 
Building Chatbots
Building ChatbotsBuilding Chatbots
Building ChatbotsTessa Mero
 

Was ist angesagt? (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
 

Ähnlich wie 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.pdfTilton2
 
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 slideRaghavendraVattikuti1
 
Git Tutorials Git vs GitHub.pptx
Git Tutorials Git vs GitHub.pptxGit Tutorials Git vs GitHub.pptx
Git Tutorials Git vs GitHub.pptxDevOps 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 2015Nina Zakharenko
 
Git_tutorial.pdf
Git_tutorial.pdfGit_tutorial.pdf
Git_tutorial.pdfAliaaTarek5
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHubDSCVSSUT
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 
Git & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbourneGit & Github Workshop - Le Wagon Melbourne
Git & Github Workshop - Le Wagon MelbournePaal Ringstad
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution processSyed Armani
 
OpenStack Contribution Process
OpenStack Contribution ProcessOpenStack Contribution Process
OpenStack Contribution Processopenstackindia
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git WorkshopBeckhamWee
 
Get your Git on GitHub
Get your Git on GitHubGet your Git on GitHub
Get your Git on GitHubRuncy Oommen
 
devops-complete-notes-2.pdf
devops-complete-notes-2.pdfdevops-complete-notes-2.pdf
devops-complete-notes-2.pdfRobinRohit2
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon MelbournePaal Ringstad
 
Contributing to Upstream Open Source Projects
Contributing to Upstream Open Source ProjectsContributing to Upstream Open Source Projects
Contributing to Upstream Open Source ProjectsScott Garman
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing selfChen-Tien Tsai
 

Ähnlich wie 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
 

Mehr von 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 SystemSingsys 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 AndroidSingsys Pte Ltd
 
iOS Application Battery Optimization Techniques
iOS Application Battery Optimization TechniquesiOS Application Battery Optimization Techniques
iOS Application Battery Optimization TechniquesSingsys Pte Ltd
 
Android Battery optimization Android Apps
Android Battery optimization Android AppsAndroid Battery optimization Android Apps
Android Battery optimization Android AppsSingsys 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 StepsSingsys Pte Ltd
 
Introduction to facebook sdk
Introduction to facebook sdkIntroduction to facebook sdk
Introduction to facebook sdkSingsys Pte Ltd
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginnersSingsys Pte Ltd
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designersSingsys Pte Ltd
 
Joomla 3 installation and management guide
Joomla 3 installation and management guideJoomla 3 installation and management guide
Joomla 3 installation and management guideSingsys Pte Ltd
 
Joomla Introduction & Installation Tutorial
Joomla Introduction & Installation TutorialJoomla Introduction & Installation Tutorial
Joomla Introduction & Installation TutorialSingsys Pte Ltd
 
Technical seo tips for web developers
Technical seo tips for web developersTechnical seo tips for web developers
Technical seo tips for web developersSingsys Pte Ltd
 
WordPress Website Design and Development
WordPress Website Design and DevelopmentWordPress Website Design and Development
WordPress Website Design and DevelopmentSingsys 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 websitesSingsys Pte Ltd
 

Mehr von 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
 

Kürzlich hochgeladen

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Kürzlich hochgeladen (20)

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

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