intro to gitp.3 what is git intro to git started in 2005 created by linus torvalds to aid...
TRANSCRIPT
GitandGerritForWorkingWithandOnQtQtWorldSummit2019
PresentedbyKevinFunk
p.2
IntrotoGit
IntrotoGit
IntrotoGit
IntrotoGerritforQt
p.3
WhatisGit
IntrotoGit
Startedin2005
CreatedbyLinusTorvaldstoaiddevelopmentoftheLinuxKernel
Primarilyusedforsourcecodemanagementinsoftwaredevelopment
Availableonallmajorplatforms:Linux,Windows,macOS
FreeandOpenSource
p.4
Keyfeatures
IntrotoGit
Instantbranchingandmerging
Smallandfast
Fullydistributed
Dataassurance/integrity
Handleshugeprojectswithease(hint:LinuxKernel)
Uniquefeature:Stagingarea
p.5
FromSubversiontoGit
IntrotoGit
Source:git-tower.com
p.6
InteractingwithGit
IntrotoGit
Mostpowerful:gitviacommand-lineButalsohasthemost-steeplearningcurve
Graphical(standalone):gitk(cross-platform;'default')GitExtensions(cross-platform;free,GPL)SourceTree(Windows,macOS;free,proprietary)manyothers!(https://git-scm.com/downloads/guis/)
Graphical(integrated):GitpluginsformostIntegratedDevelopmentEnvironments
p.7
InteractingwithGit(cont'd)
IntrotoGit
Notethatinthisguidewe'llfocusoninteractionwiththecommand-lineclient
p.8
GettingHelp
IntrotoGit
Referencemanual:https://git-scm.com/doc
Orforamorebriefversion:mangit,ORgit--help(equivalenttoabove),ORgitCOMMAND--help
p.8
GettingHelp
IntrotoGit
Referencemanual:https://git-scm.com/doc
Orforamorebriefversion:mangit,ORgit--help(equivalenttoabove),ORgitCOMMAND--help
Anotherindispensablesourceforhelp:stackoverflow.com
p.9
FirstThingsFirst
IntrotoGit
TellGitwhoyouare:gitconfig--globaluser.name"YourName"gitconfig--globaluser.email"[email protected]"
Globalsettingsfile:~/.gitconfig
Projectsettingsfile:$PROJECTDIR/.git/config
WindowsusersGitlooksforthe.gitconfigfileinthe%HOME%directory:C:\Users\%USER%formostpeople
p.10
USECASE:InitialCheck-out
IntrotoGit
Example(checkingoutfromaremotelocation):gitclonegit://code.qt.io/qt/qt5.git
Example(...andaspecificbranch):gitclonegit://code.qt.io/qt/qt5.git-b5.12
p.11
USECASE:Commit
IntrotoGit
Seeyourchanges:gitstatusORgitdiffORgitk
Markthefilesyouwanttocheckin:gitadd<files>
Checkinthemarkedfiles:gitcommitORgitcommit-m"checkinmessage"
Fetchlatestversionfromremoteserver:gitpull
Pushthechangestotheserver:gitpush
Youmaycommitallfilesusing-aoption:gitcommit-a
Demo
p.12
IntrotoGerritforQt
IntrotoGerritforQt
IntrotoGit
IntrotoGerritforQt
p.13
HowtouseGerritbyexampleofcontributingtoQt
IntrotoGerritforQt
Qt'sdevelopmentoccursintheopeninrepositoriesathttps://codereview.qt-project.org(aGerritcodereviewinstance).
Theyaremirroredread-onlyatcode.qt.io
TheQtprojectprovidesfreehostingtoprojectsrelatedtoQtwhichhavebeenincubatedandacceptedbythecommunity
CloningQt:gitclonegit://code.qt.io/qt/qt5.git
Seehttp://wiki.qt.io/Building_Qt_5_from_Gitforbuildinstructions
p.14
ContributingtoQtviaGerrit
IntrotoGerritforQt
PrerequisitesQtAccount(SSO)
https://login.qt.io/registerAccesstoGerrit
https://codereview.qt-project.org/AccesstoJIRA(forclosingbugs,etc.)
https://bugreports.qt.io/SignedContributorAgreement
CanbedoneinGerritMoreinfo:https://www.qt.io/legal-contribution-agreement-qt
p.15
ContributingtoQtviaGerrit(cont'd)
IntrotoGerritforQt
YoumightwanttosubmitapatchbacktoQt'srepositories.
TodothisyouneedtosignupforaGerritaccountathttps://codereview.qt-project.org/.
SetupforusingGerritonyourlocalclone.gitremoteaddgerritGERRIT_URL;...
Commitlocallyasusual.
Pushlocalcommitstogerrit.gitpushgerritHEAD:refs/for/5.9
orgitpushgerritHEAD:refs/for/dev
AremotehookfromGerritwillprintanURL.
OpentheresultingURL(s)andfollowthereviewprocedures.
p.16
GerritSetupforQtdevelopment
IntrotoGerritforQt
ConfigureSSH:1 Hostcodereview.qt-project.org2 Port294183 User
Addacommithook:scp-pcodereview.qt-project.org:hooks/commit-msg.git/hooks
Orcopyfromhttp://codereview.qt-project.org/tools/hooks/commit-msg
Addanew"remote"toyourclone:gitremoteaddgerritssh://codereview.qt-project.org/qt/qt5
Seehttp://wiki.qt.io/Setting-up-Gerrit
p.17
AddingreviewerstoyourChangeRequest
IntrotoGerritforQt
Findoutwhoworkedonthesourcefile(s)youarechanginggitlog[path]gitblame[path]
Oratleastaddthemodulemaintainerhttps://wiki.qt.io/Maintainers
p.18
ChangeRequest:LifeCycle
IntrotoGerritforQt
p.19
Resources
Entrypoint:https://www.qt.io/contribute-to-qthttps://wiki.qt.io/Setting_up_Gerrithttps://wiki.qt.io/Gerrit_Introduction
HelpersGitgpushscript:https://wiki.qt.io/Git-gpush-scripts
p.20
Questions?
KDABisnowofferingGittrainingsandworkshops!