+ All Categories
Home > Documents > Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code...

Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code...

Date post: 07-Aug-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
20
git Code Version Control xkcd.com Casper da Costa-Luis (ex machine vision dev & resident git-guru @Sony) PETMR Image Recon PhD Scholar @KCL [email protected] https://github.com/casperdcl 1
Transcript
Page 1: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

gitCode Version Control

xkcd.com

Casper da Costa-Luis

(ex machine vision dev & resident git-guru @Sony)

PETMR Image Recon PhD Scholar @KCL

[email protected]

https://github.com/casperdcl

1

Page 2: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

Version ctrl

Track changes for code over time

Revert to older versions easily

Collaborate efficiently

Merge conflicting code reliably

Or at least make it easy to manually do

2/20

Page 3: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

3/20

Page 4: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

4/20

Page 5: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

5/20

Page 6: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

Nomenclature

Description git-speak

Project/code database repository

Example of a website

hosting lots of projects

GitHub (https://github.com),

BitBucket (https://bitbucket.org)

Download a project clone

Mark changes to save stage

Save marked files/lines commit (repo <-> list of commits)

Download new changes pull

Fix conflicts [locally] merge (special type of commit)

Upload current state push

6/20

Page 7: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

commit

A repository is essentially a list (network) of commits

Commits are permanent checkpoints

Must have a message

xkcd.com7/20

Page 8: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

Large Projects have lots of:

Description git-speak

Developers authors

Users/nuisances watchers/stargazers

Code/versions/files commits

Official Versions tagged commits

Bugs/Feature requests issues

Minor spin-offs branches

Major spin-offs

(clone of entire repo)

fork

Suggestions to incorporate

spin-offs

merge/pull request (PR)

8/20

Page 9: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

9/20

Page 10: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

10/20

Page 11: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

11/20

Page 12: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

12/20

Page 13: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

Contributions Strategy

Only one official, stable, up-to-date branch: master

Essentially “latest stable beta version with no known bugs

since last official release version”

Any work-in-progress commits should be in their own

branches

GitHub assigns a unique number to each issue

https://github.com/CCPPETMR/SIRF/issues

13/20

Page 14: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

Contributions Strategy

A pull request (PR) is an issue with an associate branch

https://github.com/CCPPETMR/SIRF/pulls

Discussions on issues and PRs are forwarded [email protected] mailing list daily

Forwarded from github viahttps://groups.google.com/forum/#!forum/ccp-petmr-codebot,which is also a backup in case github dies

We prefer issues to be opened via github

Will never get lost in emails

Track status

Comments/discussion

Cross-reference related issues, PRs, and commits

Mailing list gets notified within 24 hours

14/20

Page 15: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

15/20

Page 16: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

Release Strategyreleasing a new official version

Must be a commit on master branch

Tag the commit using https://semver.org convention

vMajor.minor.patch(-extra)

Major: backward-incompatible

minor: new feature

patch: e.g. fix typo in documentation

v0.9.0-rc2 (Version 0.9.0 Release Candidate 2)

Add release notes

Describe changes since last release

16/20

Page 17: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

17/20

Page 18: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

git cheat sheetgit clone https://github.com/CCPPETMR/SIRF-SuperBuild

cd SIRF-SuperBuild

cmake . && make install

git pull && cmake . && make install # to update

git checkout –b mybranch # create new branch

git add myscript.m other/file.cpp

git commit –m “My cool changes”

git pull origin/master # optional

git push origin mybranch # first time needs an extra `-u`

https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf

Thre

e m

ost

use

d c

om

mands

in o

rder

of

pre

cedence

18/20

Page 19: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

Conflicts and Diffs

19/20

Page 20: Code Version Control - CCP PET-MR · 2017-05-23 · Nomenclature Description git-speak Project/code database repository Example of a website hosting lots of projects GitHub (), BitBucket

GUIsgit: Git-GUI, gitk, SmartGit

diff: vimdiff, kdiff3, meld

Help a lot with (e.g.)

Avoiding commandline,

Visualising diffs

20/20


Recommended