SlideShare a Scribd company logo
Be More Productive
Work collaboratively
How to work collaboratively on git?
• Never work on the master branch. That way, you cannot
compromise by mistake the functionality of the code that other
people are using.
• If you are developing a new function or the like, it is best to create
your own branch.
• As soon as your development is fully functional and passes all unit
tests, you can issue a pull request to master.
• Add a comment about the future of that branch, i.e. whether it can
be deleted or whether you plan to work on the same branch to
implement more changes. Even after the pull request has been
merged into master, you may keep working on the branch.
Git Conflict ?
Don’t be afraid
Conflict ? Don’t afraid
1. If you have only minor changes that can be summarized in one commit,
you will be aware of this when you type
git fetch
git status and you are shown that you are one or more commits behind the remote branch
while only one or two local files are change.
You should deal with this situation as follows
git stash
git pull
git stash pop
It often occurs that two or more people end up working on the same branch.
When you fetch the updates of other developers into your local version of the
branch with git pull you will frequently encounter conflicts. But don’t be afraid.
There are two ways to deal with this:
Conflict ? Don’t afraid
2. If you have a considerable amount of changes, we can accept the ugly merge commits. Just stay with git pull and put the keyword
'merge' into the commit message. To understand what is going on, read the copy-paste from the above link (copy-paste follows):
For example, two people are working on the same branch. The branch starts as:
...->C1
The first person finishes their work and pushes to the branch:
...->C1->C2
The second person finishes their work and wants to push, but can't because they need to update. The local repository for the second
person looks like:
...->C1->C3
If the pull is set to merge, the second persons repository will look like.
...->C1->C3->M1
 /
->C2->
Git Conflict ?
Let’s learn more about it
More on Conflict !
When conflict occurs, Git writes a special block into the file that contains the
contents of both versions where the conflict occurred:
the number of planets are
<<<<<<< HEAD
nine
=======
eight
>>>>>>> branch-a
To complete this type of merge, use your text editor to resolve the conflict, then
add the file and commit it to complete the merge. In this case, Git has trouble
understanding which change should be used, so it asks you to help out.
Pull Request
Let’s review code.
Pull Requests
• Pull requests are a feature that makes it easier for developers to
collaborate using Bitbucket.
• It is a mechanism for a developer to notify team members that they
have completed a feature.
• Once their feature branch is ready, the developer files a pull request via
their Bitbucket account. This lets everybody involved know that they
need to review the code and merge it into the master branch.
• It is more than just a notification—it’s a dedicated forum for discussing
the proposed feature. If there are any problems with the changes,
teammates can post feedback in the pull request and even tweak the
feature by pushing follow-up commits. All of this activity is tracked
directly inside of the pull request.
Pull Requests
• Always make sure your pull-request is uptodate.
• Maintain your branch until it get merged, that make reviewer life easy.
• Keep your branch always ahead of master branch, so the diff gets
pretty much what you have actually worked on.
• When creating pull request – choose close branch after merge (if not
planned to continue using same branch for improve feature), that’s a
best practice and it will delete branch once it is merged to master.
JIRA & Bitbucket
JIRA & Bitbucket
Commits Include the issue key in the commit message.
For example, a commit message like this "TIS-1 Initial commit" will automatically transition the TIS-1
issue from 'To Do' to 'In Progress'.
Branches Include the issue key in the branch name when you create the branch.
If you create the branch from the Development panel in a Jira issue, the issue key is added
automatically.
For example, if you name your branch "TIS-2_feature", the TIS-2 issue in Jira will automatically
transition from 'To Do' to 'In Progress'. (Note that Git doesn't allow spaces in branch names.)
Pull requests Do at least one of the following:
•Include a commit in the pull request that has the issue key in the commit message. Note, the commit
cannot be a merge commit.
•Include the issue key in the pull request title.
•Ensure that the source branch name includes the issue key.
If you create the pull request from the Branches dialog of the Development panel in a Jira issue, the
issue key is added automatically.
For example, if you create a pull request that has "TIS-3" in the title, the TIS-3 issue will automatically
transition from 'In Progress' to 'In Review'. If you reopen, decline, or merge the pull request, it will
also transition the TIS-3 issue accordingly.
Commit Messages
Isn’t a simple message.
Commit Messages
Commit messages are important. They are a means of communication
with yourself and your team throughout the life of your codebase
(remember that team members are likely to come and go over time.)
• Always write good commit messages
• Commit messages should be more informative
• A good commit message should tell the reader, why the change was
necessary, how the change addresses that need, and any side-effects the
change will introduce
Commit Messages
Bad commit message looks like
1. Uninformative commit messages
bug fixes
copy edit
Major refactor of all the stuffs
2. Look-elsewhere commit messages
fixes #123
[JIRA-123] update user registration
Fix ‘boo’ bug (ask Geoff for details)
Be Productive
Be Productive
There are lot you can do with Git and using those tricks you can make
your work like for smoother and productive.
1. Learn about Git Alias
git config — global alias.co checkout
2. Create a commit template
git config — global commit.template ~/.gitmessage.txt
3. Use your favourite diff tool
Questions ?
Thanks for listening
my boring talk

More Related Content

PPTX
WordPress Upgrades: Read, Set, Go!
PPTX
Branching in TFS 2010 Part I (Branching Theory)
PPTX
Git and GitFlow branching model
PDF
A Git Workflow Model or Branching Strategy
PDF
"Git Hooked!" Using Git hooks to improve your software development process
PDF
Make Your Team Flow
PPTX
Branching in TFS 2010 Part V (Sharing Code)
PPTX
Git Pull Requests
WordPress Upgrades: Read, Set, Go!
Branching in TFS 2010 Part I (Branching Theory)
Git and GitFlow branching model
A Git Workflow Model or Branching Strategy
"Git Hooked!" Using Git hooks to improve your software development process
Make Your Team Flow
Branching in TFS 2010 Part V (Sharing Code)
Git Pull Requests

Similar to E caregitpresentation (20)

PDF
Git best practices 2016
PDF
Git 101: Force-sensitive to Jedi padawan
PDF
Git cheat sheet_dark
PDF
Git cheat sheet__white
PDF
Git cheat sheet__grey
PDF
A Git MVP Workflow
PPTX
Git Tutorial (Part 2: Git Merge)
PPTX
Understanding Github and Version Control System.pptx
PDF
Git and Github workshop ppt slide by slide
PDF
Git and Github slides.pdf
PPTX
Git Session 2K23.pptx
PPTX
Technical Seminar Series: GIT Pull Requests Best Practices
PDF
Git with the flow
PPTX
Git and Github.pptx
PDF
Be a Happier Developer with Git / Productive Team #gettinggitright
PDF
Git best practices workshop
PDF
git fail --force (make it up with your pull requests)
PPTX
Ultimate Git Workflow - Seoul 2015
PDF
PDF
Git Things Done
Git best practices 2016
Git 101: Force-sensitive to Jedi padawan
Git cheat sheet_dark
Git cheat sheet__white
Git cheat sheet__grey
A Git MVP Workflow
Git Tutorial (Part 2: Git Merge)
Understanding Github and Version Control System.pptx
Git and Github workshop ppt slide by slide
Git and Github slides.pdf
Git Session 2K23.pptx
Technical Seminar Series: GIT Pull Requests Best Practices
Git with the flow
Git and Github.pptx
Be a Happier Developer with Git / Productive Team #gettinggitright
Git best practices workshop
git fail --force (make it up with your pull requests)
Ultimate Git Workflow - Seoul 2015
Git Things Done
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Modernizing your data center with Dell and AMD
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
A Presentation on Artificial Intelligence
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Electronic commerce courselecture one. Pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Modernizing your data center with Dell and AMD
Diabetes mellitus diagnosis method based random forest with bat algorithm
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Encapsulation_ Review paper, used for researhc scholars
A Presentation on Artificial Intelligence
Review of recent advances in non-invasive hemoglobin estimation
Network Security Unit 5.pdf for BCA BBA.
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Electronic commerce courselecture one. Pdf
The AUB Centre for AI in Media Proposal.docx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Monthly Chronicles - July 2025
NewMind AI Weekly Chronicles - August'25 Week I
Spectral efficient network and resource selection model in 5G networks
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
Advanced methodologies resolving dimensionality complications for autism neur...
Reach Out and Touch Someone: Haptics and Empathic Computing
Ad

E caregitpresentation

  • 3. How to work collaboratively on git? • Never work on the master branch. That way, you cannot compromise by mistake the functionality of the code that other people are using. • If you are developing a new function or the like, it is best to create your own branch. • As soon as your development is fully functional and passes all unit tests, you can issue a pull request to master. • Add a comment about the future of that branch, i.e. whether it can be deleted or whether you plan to work on the same branch to implement more changes. Even after the pull request has been merged into master, you may keep working on the branch.
  • 5. Conflict ? Don’t afraid 1. If you have only minor changes that can be summarized in one commit, you will be aware of this when you type git fetch git status and you are shown that you are one or more commits behind the remote branch while only one or two local files are change. You should deal with this situation as follows git stash git pull git stash pop It often occurs that two or more people end up working on the same branch. When you fetch the updates of other developers into your local version of the branch with git pull you will frequently encounter conflicts. But don’t be afraid. There are two ways to deal with this:
  • 6. Conflict ? Don’t afraid 2. If you have a considerable amount of changes, we can accept the ugly merge commits. Just stay with git pull and put the keyword 'merge' into the commit message. To understand what is going on, read the copy-paste from the above link (copy-paste follows): For example, two people are working on the same branch. The branch starts as: ...->C1 The first person finishes their work and pushes to the branch: ...->C1->C2 The second person finishes their work and wants to push, but can't because they need to update. The local repository for the second person looks like: ...->C1->C3 If the pull is set to merge, the second persons repository will look like. ...->C1->C3->M1 / ->C2->
  • 7. Git Conflict ? Let’s learn more about it
  • 8. More on Conflict ! When conflict occurs, Git writes a special block into the file that contains the contents of both versions where the conflict occurred: the number of planets are <<<<<<< HEAD nine ======= eight >>>>>>> branch-a To complete this type of merge, use your text editor to resolve the conflict, then add the file and commit it to complete the merge. In this case, Git has trouble understanding which change should be used, so it asks you to help out.
  • 10. Pull Requests • Pull requests are a feature that makes it easier for developers to collaborate using Bitbucket. • It is a mechanism for a developer to notify team members that they have completed a feature. • Once their feature branch is ready, the developer files a pull request via their Bitbucket account. This lets everybody involved know that they need to review the code and merge it into the master branch. • It is more than just a notification—it’s a dedicated forum for discussing the proposed feature. If there are any problems with the changes, teammates can post feedback in the pull request and even tweak the feature by pushing follow-up commits. All of this activity is tracked directly inside of the pull request.
  • 11. Pull Requests • Always make sure your pull-request is uptodate. • Maintain your branch until it get merged, that make reviewer life easy. • Keep your branch always ahead of master branch, so the diff gets pretty much what you have actually worked on. • When creating pull request – choose close branch after merge (if not planned to continue using same branch for improve feature), that’s a best practice and it will delete branch once it is merged to master.
  • 13. JIRA & Bitbucket Commits Include the issue key in the commit message. For example, a commit message like this "TIS-1 Initial commit" will automatically transition the TIS-1 issue from 'To Do' to 'In Progress'. Branches Include the issue key in the branch name when you create the branch. If you create the branch from the Development panel in a Jira issue, the issue key is added automatically. For example, if you name your branch "TIS-2_feature", the TIS-2 issue in Jira will automatically transition from 'To Do' to 'In Progress'. (Note that Git doesn't allow spaces in branch names.) Pull requests Do at least one of the following: •Include a commit in the pull request that has the issue key in the commit message. Note, the commit cannot be a merge commit. •Include the issue key in the pull request title. •Ensure that the source branch name includes the issue key. If you create the pull request from the Branches dialog of the Development panel in a Jira issue, the issue key is added automatically. For example, if you create a pull request that has "TIS-3" in the title, the TIS-3 issue will automatically transition from 'In Progress' to 'In Review'. If you reopen, decline, or merge the pull request, it will also transition the TIS-3 issue accordingly.
  • 14. Commit Messages Isn’t a simple message.
  • 15. Commit Messages Commit messages are important. They are a means of communication with yourself and your team throughout the life of your codebase (remember that team members are likely to come and go over time.) • Always write good commit messages • Commit messages should be more informative • A good commit message should tell the reader, why the change was necessary, how the change addresses that need, and any side-effects the change will introduce
  • 16. Commit Messages Bad commit message looks like 1. Uninformative commit messages bug fixes copy edit Major refactor of all the stuffs 2. Look-elsewhere commit messages fixes #123 [JIRA-123] update user registration Fix ‘boo’ bug (ask Geoff for details)
  • 18. Be Productive There are lot you can do with Git and using those tricks you can make your work like for smoother and productive. 1. Learn about Git Alias git config — global alias.co checkout 2. Create a commit template git config — global commit.template ~/.gitmessage.txt 3. Use your favourite diff tool
  • 20. Thanks for listening my boring talk

Editor's Notes

  • #2: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image.