git and gitlab - arc centre of excellence for particle ... · the 3 states git process the .git dir...

28
CoEPP Summer School @ Lorne 2012 Lucien Boland Sean Crosby Goncalo Borges Research Computing Team GIT and GITLab: Part 1 - An Introduction

Upload: others

Post on 26-Jun-2020

22 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP Summer School @ Lorne 2012

Lucien BolandSean CrosbyGoncalo BorgesResearch Computing Team

GIT and GITLab:Part 1 - An Introduction

Page 2: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Outline

● GIT in a NutshellBasic concepts

● GITLab in a NutshellAuthentication

Create a project in GITLab

Commit to a project in GITLab

Checkout from a project in GITLAB

Set different project permissions to other users

Page 3: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GIT in a Nutshell

● CVS / SVN create versions based on file differences

● GIT creates snapshots of the project over time:

Takes a picture of what files look

Stores a reference to that snapshot

If files are unchanged, stores a link to the previous identical file

SVN like GIT like

Page 4: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GIT in a Nutshell

● In GIT, nearly all operations are local

Once a repository is created or checkout, GIT only needs local

files and resources to operate

Most operations seem almost instantaneous.

● For example, to browse the history of the project, Git reads it

directly from your local database.

This means that you can do almost everything even if you’re

offline.

Page 5: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GIT in a Nutshell● The 3 states GIT process

The .git dir is where GIT stores metadata and object database

for your project. .

The working dir is a checkout of a project version ● Files are pulled out of the compressed db in the .git directory

and placed on disk for you to use / modify.

The staging area is a file (generally in .git directory), storing info

about what will go into your next commit.

Page 6: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GIT local workflow

● The basic GIT workflow

Initiate a repo in your local system (or clone a repo)

● git init (git clone <git repo>)

Modify files in your working directory;

Stage the files, adding snapshots of them to your staging area;

● git add <path>

Do a commit (takes the files in the staging area and stores that

snapshot permanently to your .git dir);

● git commit ­m '<some comment>'

Page 7: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GIT in a Nutshell

● The 3 states processgit init

git clone

git add

git commit

Page 8: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GIT local workflow

Page 9: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GITLab in a Nutshell

● What is GITLab?

A web frontend for the management of remote git repositories

(similar to GITHUB):

● Activity Stream

● File Browser

● Git Powered Wiki

● Code review

● Issue Management

● Code snippets

● Web Hooks

Page 10: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GITLab Authentication

● https://gitlab.coepp.org.auUse your CoEPP 

credentials

Non­CoEPP users 

can also have access

Page 11: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GITLab User Home

Page 12: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GITLab SSH User Keys

1) Profile Settings

Page 13: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GITLab SSH User Keys

2) SSH Keys

Page 14: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GITLab SSH User Keys

3) Add Pub SSH Key

Page 15: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GITLab SSH User Keys1) Create a project

Page 16: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Create a GITLab project

4) Project Privacy

2) Name3) Namespace

5) Project Create

Page 17: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Create a GITLab project

Access Link

Command line setup

Page 18: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GIT local repo in your PC

Page 19: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

GIT remote repo in GITLab

Page 20: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Browse a GITLab project

Page 21: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Browse a GITLab project

1) See my projects

Page 22: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Browse a GITLab project

2) See project details

3) Project files

Page 23: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Commit to remote GIT repo

Page 24: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Commit to remote GIT repo

1) Project files

2) Project Map

Page 25: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Checkout from remote GIT repo

Page 26: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Add members to a project

1) Project setting

2) Project members

3) Add new Project members

Page 27: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Add members to a project

1) Search for registered members in GITLab

2) Define the level of access

Page 28: GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir is where GIT stores metadata and object database for your project. . The working

CoEPP 2015 RC Users Forum 24th March 2015

Part 2

● Project Groups● Tags and branching● Web hooks● Merge Requests● Issues Tracker