GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir...
Transcript of GIT and GITLab - ARC Centre of Excellence for Particle ... · The 3 states GIT process The .git dir...
CoEPP Summer School @ Lorne 2012
Lucien BolandSean CrosbyGoncalo BorgesResearch Computing Team
GIT and GITLab:Part 1 - An Introduction
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
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
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.
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.
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>'
CoEPP 2015 RC Users Forum 24th March 2015
GIT in a Nutshell
● The 3 states processgit init
git clone
git add
git commit
CoEPP 2015 RC Users Forum 24th March 2015
GIT local workflow
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
CoEPP 2015 RC Users Forum 24th March 2015
GITLab Authentication
● https://gitlab.coepp.org.auUse your CoEPP
credentials
NonCoEPP users
can also have access
CoEPP 2015 RC Users Forum 24th March 2015
GITLab User Home
CoEPP 2015 RC Users Forum 24th March 2015
GITLab SSH User Keys
1) Profile Settings
CoEPP 2015 RC Users Forum 24th March 2015
GITLab SSH User Keys
2) SSH Keys
CoEPP 2015 RC Users Forum 24th March 2015
GITLab SSH User Keys
3) Add Pub SSH Key
CoEPP 2015 RC Users Forum 24th March 2015
GITLab SSH User Keys1) Create a project
CoEPP 2015 RC Users Forum 24th March 2015
Create a GITLab project
4) Project Privacy
2) Name3) Namespace
5) Project Create
CoEPP 2015 RC Users Forum 24th March 2015
Create a GITLab project
Access Link
Command line setup
CoEPP 2015 RC Users Forum 24th March 2015
GIT local repo in your PC
CoEPP 2015 RC Users Forum 24th March 2015
GIT remote repo in GITLab
CoEPP 2015 RC Users Forum 24th March 2015
Browse a GITLab project
CoEPP 2015 RC Users Forum 24th March 2015
Browse a GITLab project
1) See my projects
CoEPP 2015 RC Users Forum 24th March 2015
Browse a GITLab project
2) See project details
3) Project files
CoEPP 2015 RC Users Forum 24th March 2015
Commit to remote GIT repo
CoEPP 2015 RC Users Forum 24th March 2015
Commit to remote GIT repo
1) Project files
2) Project Map
CoEPP 2015 RC Users Forum 24th March 2015
Checkout from remote GIT repo
CoEPP 2015 RC Users Forum 24th March 2015
Add members to a project
1) Project setting
2) Project members
3) Add new Project members
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
CoEPP 2015 RC Users Forum 24th March 2015
Part 2
● Project Groups● Tags and branching● Web hooks● Merge Requests● Issues Tracker