SlideShare uma empresa Scribd logo
1 de 51
Git and BitBucket
Medhat Dawoud
/med7atdawoud
/med7atdawoud
7 January 2015
This workshop will include
Source Code Management Systems
Web-Based Code Hosting
Popular open source projects using SCM
Intro to Git
Let’s try Git Commands
Bitbucket as a web code server and management tool
7 January 2015
Source Code Management System
• It’s a way that we use to store projects’ source
code files in a tree of versions.
• With no deal, all those SCMs creators build them
on the same rules and structure.
• A lot of popular open source projects source
codes are collected together all over the world
using SCM systems.
7 January 2015
SCM Systems Examples
Lots of this type of software was created like:
7 January 2015
Web based Code Hosting
• We can use SCMS on our machine locally that
manage the code for you and create versions.
• but you can also host your code on web, this
solution make it very secure and no lose of
data under any circumstances.
7 January 2015
Web based Code Hosting Examples
A lot of Web-Based Code Servers provide Free and paid services Like:
7 January 2015
Popular projects that use web-based code Hosting
and Source Code Management Systems
Source1: https://git.wiki.kernel.org/index.php/GitProjects
Source2: https://github.com/popular/starred
7 January 2015
Popular projects that use web-based code Hosting
and Source Code Management Systems
Source1: https://git.wiki.kernel.org/index.php/GitProjects
Source2: https://github.com/popular/starred
7 January 2015
Popular projects that use web-based code Hosting
and Source Code Management Systems
Source1: https://git.wiki.kernel.org/index.php/GitProjects
Source2: https://github.com/popular/starred
7 January 2015
Popular projects that use web-based code Hosting
and Source Code Management Systems
Source1: https://git.wiki.kernel.org/index.php/GitProjects
Source2: https://github.com/popular/starred
7 January 2015
SCMS
• We approved before when we start that all SCMSs are built on
the same structure without any deal between them.
• Those all are called Source Code Management Systems
(SCMSs).
• Main task of any SCMS is to:
 Track changes to files.
 Repository / database of changes
 Working directory / current state
7 January 2015
SCMS Operations
We can sort operations that we can do
with any SCMS into 4 main categories:
 Bootstrap (init, checkout, switch branch)
 Modify (add, delete, rename, commit)
 Information (status, diff, log)
 Reference (tag, branch)
7 January 2015
Types of SCMS
There are 2 types of SCM systems:
Centralized SCM
Distributed SCM
7 January 2015
Centralized SCM
7 January 2015
Centralized SCM
o Examples: Subversion, CVS, etc.
o Everything goes to the server, commit changes to the
sever, checkout the latest revision from the server.
o No direct exchange between developers
o Operations require server, there are some drawbacks:
 Single point of failure
 Bottleneck
7 January 2015
Decentralized SCM
7 January 2015
Decentralized SCM
o Examples: Git, Mercurial, Bazaar, etc.
o Each copy of repository is identical and self-sufficient
o No need for a central server, but one may choose to have one
o Developers may directly exchange change sets over Wi-Fi at a
local coffee shop :D
o Workflow :
– Clone
– Pull / fetch
– push
7 January 2015
Ok, Let’s Start that workshop now
• Yes, it was just an intro to the Source Code
Management Mechanism and the Web-Based
Code Servers.
• Now to start talking in our session, I packed Git as
our SCM or VCS and BitBucket as a Web-based
Code Server and management tool will be
discussed later.
Are you Ready?
7 January 2015
What is Git ?
 Decentralized or Destributed Source Code
Management(SCMS).
 Superior branching and merging mechanism.
 Support various protection devices against
corruption.
 Supported by various code servers.
7 January 2015
Git History
• 2002
 Linus uses BitKeeper to track Linux.
 And BK gets Better, and Linux scale better.
• April 6, 2005
 BitKeeper drops free license.
 Linus write his own SCM, Git.
• April 18, 2005
 Git can merge.
• June 16, 2006
 Git is officially used to track Linux.
• Feb 14, 2007
 Git 1.5.0 is released.
 Major usability efforts.
7 January 2015
“ Nothing is perfect. Git is just *closer* to
perfect than any other SCM out there ”
- Linus
7 January 2015
Git First use
• If you are using Git for the first time, you will need to
download the server into your machine according to
your operation system.
• Just go to: http://git-scm.com/downloads and choose
the suitable download and install it.
7 January 2015
Git First use continue ..
• If you are using linux you will find a command that
will install Git from terminal.
• For example if you are using Ubuntu you will write
this command in you terminal:
7 January 2015
Git Command line
• Now you have installed Git on your machine and you
can go to terminal or CMD according to you OS and
write any command, for example:
$ git –-version
this command returned the version of Git you have
installed, you should find the result as follow:
7 January 2015
Git Commands
• Ok, there is a general structure of the git
command that all commands use as follow:
$ git <options> command <options>
• Git includes approximately 137 commands.
• Actually we don’t use all of them every day, so
I’ll review here the every day use commands
and let you check others.
7 January 2015
Git Common commands
Add
rm
mv
branch
checkout
clone
commit
diff
init
log
merge
pull
push
status
7 January 2015
Git Help
• For any new command for you and need a brief
documentation for it use this:
$ git <command> -h
• When you need a complete help you should write
the following command and it will open a web
page locally with the full docs for this command:
$ git <command> --help
or
$ git help <command>
7 January 2015
Git Bootstrap
• Open the project work space (directory) and
run this command inside it:
$ git init
this will create .git directory
• This directory (.git) include all meta data
about versions and commits, working trees,
changes, all configurations, … .
7 January 2015
Git Staging
• Staging means specifying files that you will commit to
the server.
• Additions:
$ git add file #This add a specific file
$ git add . #This add all changed files
• Removal:
$ git rm file #This removes a specific file
• Renames:
$ git mv old new #This renames a specific file
7 January 2015
.gitignore file
• You can create a .gitignore file in your project directory
and add files or directories that you need not to add to
the server, examples for unwanted files:
 Automatically generated code (e.g. R.java for Android)
 Settings folder of editors that is created automatically.
 If you are using any dependences on other libraries like in
PHP you can add them to composer.json and ignore them.
 Or any other unwanted files.
• So when you use add all files, git will automatically
ignore the list of files you have written in this file.
7 January 2015
Git Commit
• Commit means to apply changes of staged files or all files to
the repository locally.
• Commit changes must provided by a message that you explain
in what is the changes in your commit from the last version:
$ git commit –m ”this is the message”
• The above command commit only the staged files but if you
want to commit all files you should use this:
$ git commit -a –m ”this is the message”
• This means that the commit command here in applied on
your machine only ??? …. The answer is yes
7 January 2015
Git work flow from work to commit
7 January 2015
Git information
• You can use status:
$ git status
to shows :
• Staged
• Unstaged
• Untracked
• You can use show:
$ git show
that shows the last commit information, changes,
author, and date. It has some more configurations
that customize the result.
7 January 2015
Git information
Git show additions:
 Just shows stats
$ git show –-stat
 Just shows name and status
$ git show -–name-status
7 January 2015
Git information
• To review the latest commits or even all commits on
some repository we use log command as follow:
$ git log
• But you can also limit it to review commits in a specific
period or in some branch or last 5 for example:
$ git log -5
or
$ git log -1 master@{yesterday}
or
$ git log --author=medhatdawoud
• There are lots of additions see in docs or help.
7 January 2015
References
Tags
Branches
7 January 2015
References
• References are used to point to commits.
 To get the local branches we use:
$ git branch –l
 To get the remote branches we use:
$ git branch –r
 And to get the local tags we use:
$ git tag -l
7 January 2015
References
• Creating new branch to HEAD:
$ git branch name
new branch “name” on HEAD
• Creating new branch to a commit:
$ git branch name commit
new branch “name” on that commit
7 January 2015
References
• Switching to branch:
$ git checkout name
• We have option of creating and switching in
the same command:
$ git checkout -b name
• If you are switching to a branch that has
changes, the switching might gives error, then
you should merge with switch:
$ git checkout -m name
7 January 2015
Merging
• If your HEAD is referring to a branch and want
to merge it to other branch, simply use the
following command, assume we have A, B
branches,
$ git checkout A
$ git merge B
Assume that we have A, B, C branches and want to merge
them all in one command.
$ git checkout A
$ git merge B C
7 January 2015
Cloning
• If you have a remote code server on some host
and want to get that repository on local, you
just want to write this:
$ git clone <remote>
• This will create a directory to the current root,
with the same name of the repository you are
cloning.
7 January 2015
Let’s Play with
7 January 2015
What’s Next ?
• Git is already installed into some editors like
eclipse, aptana, … Search for your editor
installation.
• There is a good free book for git, I recommend
it for you to be more efficient in using Git as a
Source Code Management System, check it
from this link: http://progit.org
7 January 2015
An other Easy and Fast Solution
• I’ll tell you about another easy solution for
windows users, it’s a git client with great GUI that
makes every thing for you, it’s TortoiseGit
• Simply go to this link, download and install:
http://code.google.com/p/tortoisegit/wiki/Download
• Try it and I will write some more articles about
that later on my blog.
• There are 4 more clients check them on git site.
7 January 2015
BitBucket
• BitBucket is a web-based code server and also a
great management tool for software projects.
• On 29 September 2010, Bitbucket was acquired
by VC-funded Atlassian. Initially, Bitbucket only
offered hosting support for Mercurial projects.
On 3 October 2011, Bitbucket officially
announced support for Git hosting.
7 January 2015
Why Web-Based Code Hosting?
 Not to be confused with a version control
system (or SCM system).
 Not a necessity, but good to have for more
effective collaboration
7 January 2015
Why BitBucket?
• Bitbucket is completely free if you have a .edu
email address.
• Gives any one any number of repositories,
free for only 5 users, otherwise see the
payment on their site.
• Site: https://bitbucket.org
7 January 2015
Creating Repository
7 January 2015
Repository Page
o Notice these buttons in the right.
o Simple design that gives you only what you want
from a code hosting, no noisy design.
o Notice the menu ( overview, source, commits, pull
requests, issues, wiki, downloads)
 This menu has the most important functionality that
bitbucket provide for us.
 In the right of the menu is the settings of repository7 January 2015
Let’s get a tour in the site features
Try Demos with
Online Repositories
7 January 2015
End of the workshop
Thanks
Medhat Dawoud
www.medhatdawoud.com
/med7atdawoud
/med7atdawoud
7 January 2015

Mais conteúdo relacionado

Mais procurados

Git Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and TagsGit Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and TagsMikhail Melnik
 
Using Git and BitBucket
Using Git and BitBucketUsing Git and BitBucket
Using Git and BitBucketMedhat Dawoud
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierChristoph Matthies
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshareRakesh Sukumar
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHubDSCVSSUT
 
Introduction to git administration
Introduction to git administrationIntroduction to git administration
Introduction to git administrationShawn Doyle
 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_finalMythri P K
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlowMark Everard
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-BryanLearningTech
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHubVikram SV
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubGDSCIIITBbsr
 
Basic principles of Git
Basic principles of GitBasic principles of Git
Basic principles of Gitphuongvohuy
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategiesjstack
 

Mais procurados (20)

Git presentation
Git presentationGit presentation
Git presentation
 
Git
GitGit
Git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Git Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and TagsGit Series. Episode 2. Merge, Upstream Commands and Tags
Git Series. Episode 2. Merge, Upstream Commands and Tags
 
Using Git and BitBucket
Using Git and BitBucketUsing Git and BitBucket
Using Git and BitBucket
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
 
Git basic
Git basicGit basic
Git basic
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Introduction to git administration
Introduction to git administrationIntroduction to git administration
Introduction to git administration
 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlow
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHub
 
Basic principles of Git
Basic principles of GitBasic principles of Git
Basic principles of Git
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategies
 

Semelhante a Bitbucket as a code server and pmt (20)

Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 
Git hub
Git hubGit hub
Git hub
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Git workshop
Git workshopGit workshop
Git workshop
 
Git Basics
Git BasicsGit Basics
Git Basics
 
Git & Github
Git & GithubGit & Github
Git & Github
 
Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Git Overview
Git OverviewGit Overview
Git Overview
 
3 Git
3 Git3 Git
3 Git
 
Git github
Git githubGit github
Git github
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
git2.ppt
git2.pptgit2.ppt
git2.ppt
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
Git
GitGit
Git
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Setting up Git.pptx
Setting up Git.pptxSetting up Git.pptx
Setting up Git.pptx
 

Último

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 

Último (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 

Bitbucket as a code server and pmt

  • 1. Git and BitBucket Medhat Dawoud /med7atdawoud /med7atdawoud 7 January 2015
  • 2. This workshop will include Source Code Management Systems Web-Based Code Hosting Popular open source projects using SCM Intro to Git Let’s try Git Commands Bitbucket as a web code server and management tool 7 January 2015
  • 3. Source Code Management System • It’s a way that we use to store projects’ source code files in a tree of versions. • With no deal, all those SCMs creators build them on the same rules and structure. • A lot of popular open source projects source codes are collected together all over the world using SCM systems. 7 January 2015
  • 4. SCM Systems Examples Lots of this type of software was created like: 7 January 2015
  • 5. Web based Code Hosting • We can use SCMS on our machine locally that manage the code for you and create versions. • but you can also host your code on web, this solution make it very secure and no lose of data under any circumstances. 7 January 2015
  • 6. Web based Code Hosting Examples A lot of Web-Based Code Servers provide Free and paid services Like: 7 January 2015
  • 7. Popular projects that use web-based code Hosting and Source Code Management Systems Source1: https://git.wiki.kernel.org/index.php/GitProjects Source2: https://github.com/popular/starred 7 January 2015
  • 8. Popular projects that use web-based code Hosting and Source Code Management Systems Source1: https://git.wiki.kernel.org/index.php/GitProjects Source2: https://github.com/popular/starred 7 January 2015
  • 9. Popular projects that use web-based code Hosting and Source Code Management Systems Source1: https://git.wiki.kernel.org/index.php/GitProjects Source2: https://github.com/popular/starred 7 January 2015
  • 10. Popular projects that use web-based code Hosting and Source Code Management Systems Source1: https://git.wiki.kernel.org/index.php/GitProjects Source2: https://github.com/popular/starred 7 January 2015
  • 11. SCMS • We approved before when we start that all SCMSs are built on the same structure without any deal between them. • Those all are called Source Code Management Systems (SCMSs). • Main task of any SCMS is to:  Track changes to files.  Repository / database of changes  Working directory / current state 7 January 2015
  • 12. SCMS Operations We can sort operations that we can do with any SCMS into 4 main categories:  Bootstrap (init, checkout, switch branch)  Modify (add, delete, rename, commit)  Information (status, diff, log)  Reference (tag, branch) 7 January 2015
  • 13. Types of SCMS There are 2 types of SCM systems: Centralized SCM Distributed SCM 7 January 2015
  • 15. Centralized SCM o Examples: Subversion, CVS, etc. o Everything goes to the server, commit changes to the sever, checkout the latest revision from the server. o No direct exchange between developers o Operations require server, there are some drawbacks:  Single point of failure  Bottleneck 7 January 2015
  • 17. Decentralized SCM o Examples: Git, Mercurial, Bazaar, etc. o Each copy of repository is identical and self-sufficient o No need for a central server, but one may choose to have one o Developers may directly exchange change sets over Wi-Fi at a local coffee shop :D o Workflow : – Clone – Pull / fetch – push 7 January 2015
  • 18. Ok, Let’s Start that workshop now • Yes, it was just an intro to the Source Code Management Mechanism and the Web-Based Code Servers. • Now to start talking in our session, I packed Git as our SCM or VCS and BitBucket as a Web-based Code Server and management tool will be discussed later. Are you Ready? 7 January 2015
  • 19. What is Git ?  Decentralized or Destributed Source Code Management(SCMS).  Superior branching and merging mechanism.  Support various protection devices against corruption.  Supported by various code servers. 7 January 2015
  • 20. Git History • 2002  Linus uses BitKeeper to track Linux.  And BK gets Better, and Linux scale better. • April 6, 2005  BitKeeper drops free license.  Linus write his own SCM, Git. • April 18, 2005  Git can merge. • June 16, 2006  Git is officially used to track Linux. • Feb 14, 2007  Git 1.5.0 is released.  Major usability efforts. 7 January 2015
  • 21. “ Nothing is perfect. Git is just *closer* to perfect than any other SCM out there ” - Linus 7 January 2015
  • 22. Git First use • If you are using Git for the first time, you will need to download the server into your machine according to your operation system. • Just go to: http://git-scm.com/downloads and choose the suitable download and install it. 7 January 2015
  • 23. Git First use continue .. • If you are using linux you will find a command that will install Git from terminal. • For example if you are using Ubuntu you will write this command in you terminal: 7 January 2015
  • 24. Git Command line • Now you have installed Git on your machine and you can go to terminal or CMD according to you OS and write any command, for example: $ git –-version this command returned the version of Git you have installed, you should find the result as follow: 7 January 2015
  • 25. Git Commands • Ok, there is a general structure of the git command that all commands use as follow: $ git <options> command <options> • Git includes approximately 137 commands. • Actually we don’t use all of them every day, so I’ll review here the every day use commands and let you check others. 7 January 2015
  • 27. Git Help • For any new command for you and need a brief documentation for it use this: $ git <command> -h • When you need a complete help you should write the following command and it will open a web page locally with the full docs for this command: $ git <command> --help or $ git help <command> 7 January 2015
  • 28. Git Bootstrap • Open the project work space (directory) and run this command inside it: $ git init this will create .git directory • This directory (.git) include all meta data about versions and commits, working trees, changes, all configurations, … . 7 January 2015
  • 29. Git Staging • Staging means specifying files that you will commit to the server. • Additions: $ git add file #This add a specific file $ git add . #This add all changed files • Removal: $ git rm file #This removes a specific file • Renames: $ git mv old new #This renames a specific file 7 January 2015
  • 30. .gitignore file • You can create a .gitignore file in your project directory and add files or directories that you need not to add to the server, examples for unwanted files:  Automatically generated code (e.g. R.java for Android)  Settings folder of editors that is created automatically.  If you are using any dependences on other libraries like in PHP you can add them to composer.json and ignore them.  Or any other unwanted files. • So when you use add all files, git will automatically ignore the list of files you have written in this file. 7 January 2015
  • 31. Git Commit • Commit means to apply changes of staged files or all files to the repository locally. • Commit changes must provided by a message that you explain in what is the changes in your commit from the last version: $ git commit –m ”this is the message” • The above command commit only the staged files but if you want to commit all files you should use this: $ git commit -a –m ”this is the message” • This means that the commit command here in applied on your machine only ??? …. The answer is yes 7 January 2015
  • 32. Git work flow from work to commit 7 January 2015
  • 33. Git information • You can use status: $ git status to shows : • Staged • Unstaged • Untracked • You can use show: $ git show that shows the last commit information, changes, author, and date. It has some more configurations that customize the result. 7 January 2015
  • 34. Git information Git show additions:  Just shows stats $ git show –-stat  Just shows name and status $ git show -–name-status 7 January 2015
  • 35. Git information • To review the latest commits or even all commits on some repository we use log command as follow: $ git log • But you can also limit it to review commits in a specific period or in some branch or last 5 for example: $ git log -5 or $ git log -1 master@{yesterday} or $ git log --author=medhatdawoud • There are lots of additions see in docs or help. 7 January 2015
  • 37. References • References are used to point to commits.  To get the local branches we use: $ git branch –l  To get the remote branches we use: $ git branch –r  And to get the local tags we use: $ git tag -l 7 January 2015
  • 38. References • Creating new branch to HEAD: $ git branch name new branch “name” on HEAD • Creating new branch to a commit: $ git branch name commit new branch “name” on that commit 7 January 2015
  • 39. References • Switching to branch: $ git checkout name • We have option of creating and switching in the same command: $ git checkout -b name • If you are switching to a branch that has changes, the switching might gives error, then you should merge with switch: $ git checkout -m name 7 January 2015
  • 40. Merging • If your HEAD is referring to a branch and want to merge it to other branch, simply use the following command, assume we have A, B branches, $ git checkout A $ git merge B Assume that we have A, B, C branches and want to merge them all in one command. $ git checkout A $ git merge B C 7 January 2015
  • 41. Cloning • If you have a remote code server on some host and want to get that repository on local, you just want to write this: $ git clone <remote> • This will create a directory to the current root, with the same name of the repository you are cloning. 7 January 2015
  • 42. Let’s Play with 7 January 2015
  • 43. What’s Next ? • Git is already installed into some editors like eclipse, aptana, … Search for your editor installation. • There is a good free book for git, I recommend it for you to be more efficient in using Git as a Source Code Management System, check it from this link: http://progit.org 7 January 2015
  • 44. An other Easy and Fast Solution • I’ll tell you about another easy solution for windows users, it’s a git client with great GUI that makes every thing for you, it’s TortoiseGit • Simply go to this link, download and install: http://code.google.com/p/tortoisegit/wiki/Download • Try it and I will write some more articles about that later on my blog. • There are 4 more clients check them on git site. 7 January 2015
  • 45. BitBucket • BitBucket is a web-based code server and also a great management tool for software projects. • On 29 September 2010, Bitbucket was acquired by VC-funded Atlassian. Initially, Bitbucket only offered hosting support for Mercurial projects. On 3 October 2011, Bitbucket officially announced support for Git hosting. 7 January 2015
  • 46. Why Web-Based Code Hosting?  Not to be confused with a version control system (or SCM system).  Not a necessity, but good to have for more effective collaboration 7 January 2015
  • 47. Why BitBucket? • Bitbucket is completely free if you have a .edu email address. • Gives any one any number of repositories, free for only 5 users, otherwise see the payment on their site. • Site: https://bitbucket.org 7 January 2015
  • 49. Repository Page o Notice these buttons in the right. o Simple design that gives you only what you want from a code hosting, no noisy design. o Notice the menu ( overview, source, commits, pull requests, issues, wiki, downloads)  This menu has the most important functionality that bitbucket provide for us.  In the right of the menu is the settings of repository7 January 2015
  • 50. Let’s get a tour in the site features Try Demos with Online Repositories 7 January 2015
  • 51. End of the workshop Thanks Medhat Dawoud www.medhatdawoud.com /med7atdawoud /med7atdawoud 7 January 2015