SlideShare a Scribd company logo
p. 1
Software Versioning with
Bitbucket and Eclipse
Huseyin Ergin
p. 2
Software Change
• Whenever a product is maintained, there will
be a version.
p. 3
Staged Model
p. 4
Versioned Staged Model
• Used with software that has a large user base
• Evolution is the backbone of this process
– Evolution produces versions
– Versions are serviced, phased-out, closed down
p. 5
Versioned Staged Model
p. 6
Firefox Version History
p. 7
There’s A Problem
• How do we keep track all of these versions?
– Backup folders?
– What if the project is very large?
• What about pushing bug-fixes into multiple
versions?
• Collaboration?
– Manually merge changes?
– Disallow parallel work on the same files?
p. 8
We Were All There!
p. 9
Solution: Version Control
• Project tracking
– Who did what
– When were artifacts created/removed
– Provides complete evolution
• Collaboration
– Easy sharing
– Guarantee of synchronization
• Protection
– Data loss
– Bad/undesired code
p. 10
What Gets Versioned?
• Text
– Truly versioned
– Differences between versions can be shown and
documented
– Line by line tracking
• Binary (non-text)
– Each version must be completely stored
– No line by line granularity
p. 11
Version Control System
p. 12
Repository a.k.a “repo”
• Stores all data associated with a project
• Centralized
– Canonical copy is stored on the server
– Easy to tell if you’re up to date
• Decentralized
– No repo holds the official copy
– Quick setup time
p. 13
Trunk & Branch & Tag
• Trunk: Main body of the program
• Branch: A copy of the trunk made at the time
of branch
– Major revisions, experimental features,
prototyping
• Tag: A stable release/milestone of the project
p. 14
Diff & Merge
• Diff produces a patch file that identifies what
changes the programmer made in the file.
– Comparison of the new and existing file
• Merge takes original file and patch file
– Merges the changes in the old file, thus creates a new
file
p. 15
Merge
• Automated
– Often works, but may not be available
• Semi-automated
– Requires some input on what changes to keep
• Manual
– Tedious and error-prone
p. 16
Checkout/Update & Commit
• Checkout: copies a file from a repo to local
storage
– Programmer changes the copy in local, not the
repo version
– Protects the code in repo until it’s ready to be
merged
• First time: Checkout
• Then: update to get
changes
p. 17
Checkout/Update & Commit
• Commit: Writes the modified file back to the
repository
p. 18
Commit
• Generally handled using diff and merge
– Diff creates a patch of changes between the repo
version and local version of the file
– Merge applies the patch to the repo version
– Repo is now up-to-date
• Commit tracks the changed files as a new
revision or version of the file.
p. 19
Lock
• Prevents the marked
file(s) from being
committed to
– Useful when:
•making critical updates
•merging may be difficult
•Exclusive access is
required
p. 20
Conflict
• Happens when
programmers work
on same files
p. 21
Resolution of Conflict
• Options:
– Merge files using semi-autonomous or manual
tools
– Clobber the upcoming changes
– Lose your own change, get the new file and make
your changes again
• A BETTER PRACTICE: Always try to work on
separate files
– Separate source codes into files
– Virtual Paradigm Projects into different files
p. 22
VCSs in the Wild
• Centralized Decentralized
– Subversion --GIT
p. 23
Subversion
• Mature VCS, released in 2000
• Native support for binaries (previously CVS
didn’t support)
• Easy to use
• Have to be connected to server to commit
p. 24
GIT
• New, 2005
• Distributed
• Repo everywhere
• NOT have to be connected to server to
commit
• We use GIT for this semester
p. 25
GIT HANDS-ON
p. 26
GIT Terminology
• Clone
– Same as checkout but also creating a repo for your local
computer (distributed, remember?)
• Fetch
– Check if anything changed in remote repo
• Stage (or Add)
– Approve changes to be committed
• Commit
– Same meaning but only commits to local repo
• Push
– Applies the local commits to remote repo
• Pull
– Same as update, gets the changes from main repo to local repo
p. 27
Workflow Summary
• Starting a project
1. Clone
• Working on a project
– Get changes of your team members
1. Fetch to peek
2. Pull to get
– Submit your changes to remote repo
1. Stage to verify your changes
2. Commit to put it to local repo
3. Push to put it to remote repo
p. 28
Tools
• Eclipse has already support for GIT
– http://www.eclipse.org/downloads/packages/ecli
pse-ide-java-developers/marsr
• Bitbucket account
p. 29
Setup Eclipse Git
• Window > Preferences
– Team > Git > Configuration
• Add two new entries
– user.email = your bitbucket email
– user.name = your bitbucket username
p. 30
Clone
• File > Import > next
p. 31
Clone – cont’d
• Clone URI > next
p. 32
Clone – cont’d
• URI: for try
– https://bitbucket.org/hergin/cs200tryout.git
• Copy/paste your URI to the URI field. Host and repo path will
automatically be completed.
• Enter your bitbucket user name and password > next
p. 33
Clone – cont’d
• No change > Next
p. 34
Clone – cont’d
• If you want, you can set a directory for your
local repo > Next
p. 35
Clone – cont’d
• Import existing projects > Next
p. 36
Clone – cont’d
• Should see a project here! > finish
p. 37
Clone – cont’d
• Now you have imported your project on
remote git repo to your local computer
– You should see it in Package Explorer
p. 38
GIT Perspective
• Many git commands can easily be handled
using git perspective in eclipse
• Windows > Open Perspective > Other
– Git > ok
p. 39
Change Between Perspectives
• Easily change between Java development
perspective and Git perspective on top-right
of Eclipse
• Or the same menu as in previous slide
p. 40
GIT Pespective
p. 41
Stage
• Add a new file / change some file content
• See the addition or change in Git Staging view
under Git Perspective
p. 42
Stage – cont’d
• Drag and drop whichever changes you want
from unstaged changes to staged changes area
• Write a commit message about the change
– Messages are useful while looking at the history and
understanding what happened before in the repo
• Commit and Push
to directly push it
to remote repo
• Commit to save the
changes in your
local repo
p. 43
Commit & Push
• If you click commit & push, you will see this screen
• The change is applied on remote repo
– Meaning other team members can fetch or pull this
change
p. 44
Commit
• If you clicked just commit
– You will not see a confirmation popup
– But you will see an up arrow just at the end of the
project name
•Meaning you have “commited” but “not pushed”
changes
p. 45
Push
• Right click on the project name and click
push to upstream to put changes to remote
repo
p. 46
Push – cont’d
• If push is successful, you will see this popup
p. 47
Push – cont’d
• If other members pushed some changes before you,
you will get this error.
• In order to avoid this one, you should pull these
changes first.
p. 48
Fetch
• Right click on project name > Fetch from
Upstream
– To see other’s changes (Peeking only)
p. 49
Fetch – cont’d
• If anything is added, you will see this popup
– And another number with down arrow in project
name
p. 50
Pull
• In order to get the changes you just fetched,
right click on project name and click Pull
p. 51
Pull – cont’d
• You should see this confirmation popup
p. 52
Conflicts
• You will always end up with conflicts!
• If you don’t work on the same file, GIT
handles the conflicts for you while you pull
the changes
p. 53
Conflicts – cont’d
• If other team member changed a file
– “staged”, “committed”, and “pushed”
• Then you changed a file,
– “staged”, “committed”, and tried to push
• Of course you can’t. Warning!
– You should pull first.
• And when you pull: “Conflicts”!
p. 54
Conflicts – cont’d
• And conflicted files will be in staging area.
p. 55
Conflicts – cont’d
• Right click on any conflicted file
– And open it using merge tool
p. 56
Merge Tool
• Will open the conflicted file side by side with
conflicting changes in red if it is same lines.
p. 57
Merge Tool
• Or it will just show the differences in the files
p. 58
Merge Tool – cont’d
• You can get the remote change to your local
copy.
p. 59
Merge Tool – cont’d
• Then save the file.
• Stage it and continue either:
– Commit and push or
– Commit
p. 60
Conflicts – cont’d
• If you solve all conflicts using merge tool and
stage them.
– Your project name will reflect this as “Merged”:
– Now you can push.
p. 61
Conflicts – Final Remarks
• Best strategy:
– Try to avoid conflicts instead of solving them later
because merging is tedious and error-prone task.
– Every now and then, before working on a project,
pull first and keep synchronized with the remote
repo.
– Push frequently!
• The best way is to work on separate files.
• Keep in mind: conflict management is easier in
text files.
– Binary files are not possible to merge, so you either
choose to keep the remote copy or your copy.
p. 62
Conclusion
• All these features are available via command
line.
• There are other tools, but we will stick with
eclipse’s own git manager.
• All your commits and source codes are
available online under your team’s repo.

More Related Content

PPTX
Version controll.pptx
PPTX
Using Git and BitBucket
PDF
Gitt and Git-flow
PPTX
git-and-bitbucket
KEY
Git with bitbucket
PDF
Bitbucket and Git
PDF
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Version controll.pptx
Using Git and BitBucket
Gitt and Git-flow
git-and-bitbucket
Git with bitbucket
Bitbucket and Git
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum

What's hot (20)

PDF
Git and GitHub workflows
PPTX
Introduction to git administration
PPTX
Git and github fundamentals
PPTX
Git 101
PPTX
Introduction to github slideshare
PPTX
Workshop on Git and GitHub
PPTX
BitBucket presentation
PPTX
Introduction to git and github
PPTX
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
PDF
Introduction to Git and GitHub
PDF
Introduction to Git
PPTX
HacktoberFest-Git&GitHub
PPTX
Introduction to Git and Github
PDF
PDF
Git Version Control System
PPTX
Git Presentation
PPTX
Git n git hub
PDF
Intro to Git & GitHub
PDF
How Git and Gerrit make you more productive
PPTX
Bitbucket
Git and GitHub workflows
Introduction to git administration
Git and github fundamentals
Git 101
Introduction to github slideshare
Workshop on Git and GitHub
BitBucket presentation
Introduction to git and github
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Introduction to Git and GitHub
Introduction to Git
HacktoberFest-Git&GitHub
Introduction to Git and Github
Git Version Control System
Git Presentation
Git n git hub
Intro to Git & GitHub
How Git and Gerrit make you more productive
Bitbucket
Ad

Similar to Software Versioning with Bitbucket and Eclipse (20)

PPTX
3DC Intro to Git Workshop
PPTX
02-version control(DevOps Series)
ZIP
Beginner's Guide to Version Control with Git
PPTX
Git & Github
PPTX
Bekerja dengan git v2 materi untuk kelas RPL
PDF
Hg for bioinformatics, second part
PPT
PDF
Version control
PDF
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
PPTX
Mercurial training
PPT
Source control
PPTX
Quick and easy way to get started with Git & GitHub
PPTX
GIT In Detail
PDF
Version control and GIT Primer
PPTX
GIT INTRODUCTION
PPTX
GDSC Git event 2023.pptx
PPTX
GIT.pptx
PPTX
Version control git day01
PPTX
Version control git day01
PDF
Git, GitHub and Open Source
3DC Intro to Git Workshop
02-version control(DevOps Series)
Beginner's Guide to Version Control with Git
Git & Github
Bekerja dengan git v2 materi untuk kelas RPL
Hg for bioinformatics, second part
Version control
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Mercurial training
Source control
Quick and easy way to get started with Git & GitHub
GIT In Detail
Version control and GIT Primer
GIT INTRODUCTION
GDSC Git event 2023.pptx
GIT.pptx
Version control git day01
Version control git day01
Git, GitHub and Open Source
Ad

More from Hüseyin Ergin (8)

PDF
Is there life after code?
PDF
SITE - CS Presentation
PDF
Object oriented programming
PDF
From the book: 50 Proven Ways to Be Persuasive
PDF
Object Oriented Paradigm
PPTX
Proxy Pattern
PPTX
Flyweight Pattern
PPTX
Chain of Responsibility Pattern
Is there life after code?
SITE - CS Presentation
Object oriented programming
From the book: 50 Proven Ways to Be Persuasive
Object Oriented Paradigm
Proxy Pattern
Flyweight Pattern
Chain of Responsibility Pattern

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
System and Network Administration Chapter 2
PPTX
ai tools demonstartion for schools and inter college
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
AI in Product Development-omnex systems
PPTX
Essential Infomation Tech presentation.pptx
PDF
top salesforce developer skills in 2025.pdf
PPTX
Transform Your Business with a Software ERP System
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Nekopoi APK 2025 free lastest update
PDF
medical staffing services at VALiNTRY
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Digital Strategies for Manufacturing Companies
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Operating system designcfffgfgggggggvggggggggg
System and Network Administration Chapter 2
ai tools demonstartion for schools and inter college
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
2025 Textile ERP Trends: SAP, Odoo & Oracle
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
AI in Product Development-omnex systems
Essential Infomation Tech presentation.pptx
top salesforce developer skills in 2025.pdf
Transform Your Business with a Software ERP System
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Wondershare Filmora 15 Crack With Activation Key [2025
Nekopoi APK 2025 free lastest update
medical staffing services at VALiNTRY
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Upgrade and Innovation Strategies for SAP ERP Customers
Digital Strategies for Manufacturing Companies
Which alternative to Crystal Reports is best for small or large businesses.pdf

Software Versioning with Bitbucket and Eclipse

  • 1. p. 1 Software Versioning with Bitbucket and Eclipse Huseyin Ergin
  • 2. p. 2 Software Change • Whenever a product is maintained, there will be a version.
  • 4. p. 4 Versioned Staged Model • Used with software that has a large user base • Evolution is the backbone of this process – Evolution produces versions – Versions are serviced, phased-out, closed down
  • 7. p. 7 There’s A Problem • How do we keep track all of these versions? – Backup folders? – What if the project is very large? • What about pushing bug-fixes into multiple versions? • Collaboration? – Manually merge changes? – Disallow parallel work on the same files?
  • 8. p. 8 We Were All There!
  • 9. p. 9 Solution: Version Control • Project tracking – Who did what – When were artifacts created/removed – Provides complete evolution • Collaboration – Easy sharing – Guarantee of synchronization • Protection – Data loss – Bad/undesired code
  • 10. p. 10 What Gets Versioned? • Text – Truly versioned – Differences between versions can be shown and documented – Line by line tracking • Binary (non-text) – Each version must be completely stored – No line by line granularity
  • 12. p. 12 Repository a.k.a “repo” • Stores all data associated with a project • Centralized – Canonical copy is stored on the server – Easy to tell if you’re up to date • Decentralized – No repo holds the official copy – Quick setup time
  • 13. p. 13 Trunk & Branch & Tag • Trunk: Main body of the program • Branch: A copy of the trunk made at the time of branch – Major revisions, experimental features, prototyping • Tag: A stable release/milestone of the project
  • 14. p. 14 Diff & Merge • Diff produces a patch file that identifies what changes the programmer made in the file. – Comparison of the new and existing file • Merge takes original file and patch file – Merges the changes in the old file, thus creates a new file
  • 15. p. 15 Merge • Automated – Often works, but may not be available • Semi-automated – Requires some input on what changes to keep • Manual – Tedious and error-prone
  • 16. p. 16 Checkout/Update & Commit • Checkout: copies a file from a repo to local storage – Programmer changes the copy in local, not the repo version – Protects the code in repo until it’s ready to be merged • First time: Checkout • Then: update to get changes
  • 17. p. 17 Checkout/Update & Commit • Commit: Writes the modified file back to the repository
  • 18. p. 18 Commit • Generally handled using diff and merge – Diff creates a patch of changes between the repo version and local version of the file – Merge applies the patch to the repo version – Repo is now up-to-date • Commit tracks the changed files as a new revision or version of the file.
  • 19. p. 19 Lock • Prevents the marked file(s) from being committed to – Useful when: •making critical updates •merging may be difficult •Exclusive access is required
  • 20. p. 20 Conflict • Happens when programmers work on same files
  • 21. p. 21 Resolution of Conflict • Options: – Merge files using semi-autonomous or manual tools – Clobber the upcoming changes – Lose your own change, get the new file and make your changes again • A BETTER PRACTICE: Always try to work on separate files – Separate source codes into files – Virtual Paradigm Projects into different files
  • 22. p. 22 VCSs in the Wild • Centralized Decentralized – Subversion --GIT
  • 23. p. 23 Subversion • Mature VCS, released in 2000 • Native support for binaries (previously CVS didn’t support) • Easy to use • Have to be connected to server to commit
  • 24. p. 24 GIT • New, 2005 • Distributed • Repo everywhere • NOT have to be connected to server to commit • We use GIT for this semester
  • 26. p. 26 GIT Terminology • Clone – Same as checkout but also creating a repo for your local computer (distributed, remember?) • Fetch – Check if anything changed in remote repo • Stage (or Add) – Approve changes to be committed • Commit – Same meaning but only commits to local repo • Push – Applies the local commits to remote repo • Pull – Same as update, gets the changes from main repo to local repo
  • 27. p. 27 Workflow Summary • Starting a project 1. Clone • Working on a project – Get changes of your team members 1. Fetch to peek 2. Pull to get – Submit your changes to remote repo 1. Stage to verify your changes 2. Commit to put it to local repo 3. Push to put it to remote repo
  • 28. p. 28 Tools • Eclipse has already support for GIT – http://www.eclipse.org/downloads/packages/ecli pse-ide-java-developers/marsr • Bitbucket account
  • 29. p. 29 Setup Eclipse Git • Window > Preferences – Team > Git > Configuration • Add two new entries – user.email = your bitbucket email – user.name = your bitbucket username
  • 30. p. 30 Clone • File > Import > next
  • 31. p. 31 Clone – cont’d • Clone URI > next
  • 32. p. 32 Clone – cont’d • URI: for try – https://bitbucket.org/hergin/cs200tryout.git • Copy/paste your URI to the URI field. Host and repo path will automatically be completed. • Enter your bitbucket user name and password > next
  • 33. p. 33 Clone – cont’d • No change > Next
  • 34. p. 34 Clone – cont’d • If you want, you can set a directory for your local repo > Next
  • 35. p. 35 Clone – cont’d • Import existing projects > Next
  • 36. p. 36 Clone – cont’d • Should see a project here! > finish
  • 37. p. 37 Clone – cont’d • Now you have imported your project on remote git repo to your local computer – You should see it in Package Explorer
  • 38. p. 38 GIT Perspective • Many git commands can easily be handled using git perspective in eclipse • Windows > Open Perspective > Other – Git > ok
  • 39. p. 39 Change Between Perspectives • Easily change between Java development perspective and Git perspective on top-right of Eclipse • Or the same menu as in previous slide
  • 41. p. 41 Stage • Add a new file / change some file content • See the addition or change in Git Staging view under Git Perspective
  • 42. p. 42 Stage – cont’d • Drag and drop whichever changes you want from unstaged changes to staged changes area • Write a commit message about the change – Messages are useful while looking at the history and understanding what happened before in the repo • Commit and Push to directly push it to remote repo • Commit to save the changes in your local repo
  • 43. p. 43 Commit & Push • If you click commit & push, you will see this screen • The change is applied on remote repo – Meaning other team members can fetch or pull this change
  • 44. p. 44 Commit • If you clicked just commit – You will not see a confirmation popup – But you will see an up arrow just at the end of the project name •Meaning you have “commited” but “not pushed” changes
  • 45. p. 45 Push • Right click on the project name and click push to upstream to put changes to remote repo
  • 46. p. 46 Push – cont’d • If push is successful, you will see this popup
  • 47. p. 47 Push – cont’d • If other members pushed some changes before you, you will get this error. • In order to avoid this one, you should pull these changes first.
  • 48. p. 48 Fetch • Right click on project name > Fetch from Upstream – To see other’s changes (Peeking only)
  • 49. p. 49 Fetch – cont’d • If anything is added, you will see this popup – And another number with down arrow in project name
  • 50. p. 50 Pull • In order to get the changes you just fetched, right click on project name and click Pull
  • 51. p. 51 Pull – cont’d • You should see this confirmation popup
  • 52. p. 52 Conflicts • You will always end up with conflicts! • If you don’t work on the same file, GIT handles the conflicts for you while you pull the changes
  • 53. p. 53 Conflicts – cont’d • If other team member changed a file – “staged”, “committed”, and “pushed” • Then you changed a file, – “staged”, “committed”, and tried to push • Of course you can’t. Warning! – You should pull first. • And when you pull: “Conflicts”!
  • 54. p. 54 Conflicts – cont’d • And conflicted files will be in staging area.
  • 55. p. 55 Conflicts – cont’d • Right click on any conflicted file – And open it using merge tool
  • 56. p. 56 Merge Tool • Will open the conflicted file side by side with conflicting changes in red if it is same lines.
  • 57. p. 57 Merge Tool • Or it will just show the differences in the files
  • 58. p. 58 Merge Tool – cont’d • You can get the remote change to your local copy.
  • 59. p. 59 Merge Tool – cont’d • Then save the file. • Stage it and continue either: – Commit and push or – Commit
  • 60. p. 60 Conflicts – cont’d • If you solve all conflicts using merge tool and stage them. – Your project name will reflect this as “Merged”: – Now you can push.
  • 61. p. 61 Conflicts – Final Remarks • Best strategy: – Try to avoid conflicts instead of solving them later because merging is tedious and error-prone task. – Every now and then, before working on a project, pull first and keep synchronized with the remote repo. – Push frequently! • The best way is to work on separate files. • Keep in mind: conflict management is easier in text files. – Binary files are not possible to merge, so you either choose to keep the remote copy or your copy.
  • 62. p. 62 Conclusion • All these features are available via command line. • There are other tools, but we will stick with eclipse’s own git manager. • All your commits and source codes are available online under your team’s repo.