SlideShare una empresa de Scribd logo
1 de 57
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Brown bag - Crash course
From «I cloned», to «I push»
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Agenda
● Presentation (20’)
o Basic commands
o Branching and merging
o Git repositories and sharing code
● Q&A (5’)
● Quiz (5’)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Git setup
$ git config --global user.name "FOO BAR"
$ git config --global user.email foobar@acme.com
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
The very beginning
$ mkdir ccbb-git
$ cd ccbb-git
$ ll
total 0
drwxr-xr-x 2 simo6545 1604020879 68 Feb 1 09:01 ./
drwxr-xr-x 117 simo6545 1604020879 3978 Feb 1 09:01 ../
local directory
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Working directory
$ git
usage: git [--version] [--help] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-
path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
...
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Working directory - poking around
$ echo 'The very beginning' > README
$ git status
fatal: Not a git repository (or any of the parent directories): .git
$ ls -la
total 8
drwxr-xr-x 3 simo6545 1604020879 102 Feb 1 09:28 .
drwxr-xr-x 117 simo6545 1604020879 3978 Feb 1 09:01 ..
-rw-r--r-- 1 simo6545 1604020879 19 Feb 1 09:28 README
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Working directory - create repository
$ git init
Initialized empty Git repository in /Users/simo6545/tmp/20140201-090152/.git/
$ ll
total 8
drwxr-xr-x 4 simo6545 1604020879 136 Feb 1 09:38 ./
drwxr-xr-x 117 simo6545 1604020879 3978 Feb 1 09:01 ../
drwxr-xr-x 9 simo6545 1604020879 306 Feb 1 09:39 .git/
-rw-r--r-- 1 simo6545 1604020879 19 Feb 1 09:28 README
working directory
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Working directory status
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# README
nothing added to commit but untracked files present (use "git add" to track)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Staging area
$ git status -s
?? README
$ git add README
$ git status -s
A README
stage changes
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Staging area
$ echo 'This is the second line.' >> README
$ git status -s
AM README
$ git diff
diff --git a/README b/README
index 939d82f..9e92fed 100644
--- a/README
+++ b/README
@@ -1 +1,2 @@
The very beginning
+This is the second line.
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Staging area
$ git add README
$ git status -s
A README
Stage changes again:
$ git diff
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Commit to Git repository
$ git commit -m 'First commit'
[master (root-commit) 7c23e33] First commit
1 file changed, 2 insertions(+)
create mode 100644 README
$ git log
commit 7c23e33b09b4863dbf59dbaec7bb023f7ff15c70
Author: Simone Soldateschi <simone.soldateschi@gmail.com>
Date: Sat Feb 1 10:10:48 2014 +0000
First commit
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Recap - The three states
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Basic commands
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Tagging
$ git tag v0.1
$ git lg
* 7c23e33 - (HEAD, tag: v0.1, master) First commit (63 minutes ago)
$ echo 'Still working...' >> README
$ git status -s
M README
$ git add README
$ git status -s
M README
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Tagging
$ git commit -m 'Second commit'
[master a0a8c4b] Second commit
1 file changed, 1 insertion(+)
$ git status -s
$ git lg
* a0a8c4b - (HEAD, master) Second commit (6 seconds ago)
* 7c23e33 - (tag: v0.1) First commit (67 minutes ago)
$ git tag v0.2
$ git lg
* a0a8c4b - (HEAD, tag: v0.2, master) Second commit (6 seconds ago)
* 7c23e33 - (tag: v0.1) First commit (67 minutes ago)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
File status lifecycle
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Agenda
● Presentation (20’)
o Basic commands
o Branching and merging
o Git repositories and sharing code
● Q&A (5’)
● Quiz (5’)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Branching
$ git init
Initialized empty Git repository in
/Users/simo6545/tmp/20140201-090152/.git/
$ echo 'The first line' > README
$ git add README
$ git commit -m 'C0'
[master (root-commit) 38e3df8] C0
1 file changed, 1 insertion(+)
create mode 100644 README
$ echo 'The second line' >> README
$ git add README
$ git commit -m 'C1'
[master 836e142] C1
1 file changed, 1 insertion(+)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Branching
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Branching
$ echo 'Experimental line' >> README
$ git add README
$ git commit -m "C2"
[experiment 18c3f30] C2
1 file changed, 1 insertion(+)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Branching
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Branching
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Branching
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Branching
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Branching
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Merging
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Merge conflict
$ git merge experiment
Auto-merging README
CONFLICT (content): Merge conflict in README
Automatic merge failed; fix conflicts and then commit the result.
$ cat README
The first line
The second line
<<<<<<< HEAD
The third line
=======
Experimental line
Another experimental line
The last experimental line
>>>>>>> experiment
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Merge conflict
$ cat README
The first line
The second line
The third line
Experimental line
Another experimental line
The last experimental line
$ git add README
$ git commit -m ‘C6’
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Rollback
Current content of README:
Look at repository logs:
Rollback:
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Rollback
How does README look like?
What about repository logs?
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Checkout
List branches (?!)
Restore master
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Agenda
● Presentation (20’)
o Basic commands
o Branching and merging
o Git repositories and sharing code
● Q&A (5’)
● Quiz (5’)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Git repos & sharing code
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Git repos & sharing code
http://gitorious.org
http://gna.org/projects/savane/
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Git repos & sharing code
● remote
● clone
● pull
● push
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Remote repository
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Remote repository
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Remote repository
$ git remote
origin
$ git remote -v
origin git@github.com:siso/ccbbgit.git (fetch)
origin git@github.com:siso/ccbbgit.git (push)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Remote repository
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
pull
do stuff
push
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Remote repository - README.md
$ cat > README.md << EOF
# Git Crash Course - Brown Bag
## Paragraph 1
* **Lorem ipsum dolor sit amet**, consectetur adipiscing elit. Donec tempor justo
vitae nisi condimentum, id lobortis turpis tincidunt.
## Paragraph 2
* Duis egestas arcu quis elit posuere, vel iaculis lacus lobortis. Duis ultricies
sem in diam facilisis, eget blandit mi rutrum.
EOF
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Markdown
Markdown cheatsheethttps://github.com/adam-p/markdown-
here/wiki/Markdown-Cheatsheet
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Remote repository - push
$ git add README.md
$ git commit -m 'first release'
[master e0b1158] first release
1 file changed, 6 insertions(+)
$ git push origin master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 464 bytes | 0 bytes/s,
done.
Total 3 (delta 0), reused 0 (delta 0)
To git@github.com:siso/ccbbgit.git
5df3dad..e0b1158 master -> master
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Remote repository
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
local actions
and objects
remote actions
and objects
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
A successful branching model
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Git aliases
$ git config --global alias.b branch
$ git config --global alias.lg log --graph --pretty=format:'%Cred%h%Creset -
%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
$ git config --global alias.serve !git daemon --reuseaddr --verbose --base-
path=. --export-all ./.git
$ git config --global alias.st status st
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Agenda
● Presentation (20’)
o Basic commands
o Branching and merging
o Git repositories and sharing code
● Q&A (5’)
● Quiz (5’)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Agenda
● Presentation (20’)
o Basic commands
o Branching and merging
o Git repositories and sharing code
● Q&A (5’)
● Quiz (5’)
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Quiz
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Give your feedback!
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
References
Git SCMhttp://git-scm.com/
A Visual Git Referencehttp://marklodato.github.io/visual-git-guide/index-
en.html
Git Workflowshttps://www.atlassian.com/git/workflows
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
Homework
● Replay examples
● commit result to GitHub
● send me a message
RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk

Más contenido relacionado

La actualidad más candente

ODS Packages
ODS PackagesODS Packages
ODS Packageseagebhart
 
DNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing SolutionsDNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing SolutionsMen and Mice
 
Apache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsApache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsJean-Frederic Clere
 
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOSPart 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOSMen and Mice
 
Yeti DNS - Experimenting at the root
Yeti DNS - Experimenting at the rootYeti DNS - Experimenting at the root
Yeti DNS - Experimenting at the rootMen and Mice
 
How to send DNS over anything encrypted
How to send DNS over anything encryptedHow to send DNS over anything encrypted
How to send DNS over anything encryptedMen and Mice
 
The DNSSEC KSK of the root rolls
The DNSSEC KSK of the root rollsThe DNSSEC KSK of the root rolls
The DNSSEC KSK of the root rollsMen and Mice
 
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊Po-Jen Lai
 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopAll Things Open
 
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our ServersHTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our ServersJean-Frederic Clere
 
DNSSEC signing Tutorial
DNSSEC signing Tutorial DNSSEC signing Tutorial
DNSSEC signing Tutorial Men and Mice
 
Part 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows NetworksPart 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows NetworksMen and Mice
 
TDC2016SP - Vamos falar sobre o futuro da web: HTTP/2
TDC2016SP - Vamos falar sobre o futuro da web: HTTP/2TDC2016SP - Vamos falar sobre o futuro da web: HTTP/2
TDC2016SP - Vamos falar sobre o futuro da web: HTTP/2tdc-globalcode
 
[ETHCon Korea 2019] Shin mansun 신만선
[ETHCon Korea 2019] Shin mansun 신만선[ETHCon Korea 2019] Shin mansun 신만선
[ETHCon Korea 2019] Shin mansun 신만선ethconkr
 
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin StożekJDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin StożekPROIDEA
 
Namespaces for Local Networks
Namespaces for Local NetworksNamespaces for Local Networks
Namespaces for Local NetworksMen and Mice
 

La actualidad más candente (18)

ODS Packages
ODS PackagesODS Packages
ODS Packages
 
DNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing SolutionsDNS High-Availability Tools - Open-Source Load Balancing Solutions
DNS High-Availability Tools - Open-Source Load Balancing Solutions
 
Apache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsApache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validations
 
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOSPart 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
Part 3 - Local Name Resolution in Linux, FreeBSD and macOS/iOS
 
Yeti DNS - Experimenting at the root
Yeti DNS - Experimenting at the rootYeti DNS - Experimenting at the root
Yeti DNS - Experimenting at the root
 
How to send DNS over anything encrypted
How to send DNS over anything encryptedHow to send DNS over anything encrypted
How to send DNS over anything encrypted
 
The DNSSEC KSK of the root rolls
The DNSSEC KSK of the root rollsThe DNSSEC KSK of the root rolls
The DNSSEC KSK of the root rolls
 
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
COSCUP 2016 - ROS + Gazebo機器人模擬器工作坊
 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub Workshop
 
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our ServersHTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
 
Snaps on open suse
Snaps on open suseSnaps on open suse
Snaps on open suse
 
An API Your Parents Would Be Proud Of
An API Your Parents Would Be Proud OfAn API Your Parents Would Be Proud Of
An API Your Parents Would Be Proud Of
 
DNSSEC signing Tutorial
DNSSEC signing Tutorial DNSSEC signing Tutorial
DNSSEC signing Tutorial
 
Part 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows NetworksPart 2 - Local Name Resolution in Windows Networks
Part 2 - Local Name Resolution in Windows Networks
 
TDC2016SP - Vamos falar sobre o futuro da web: HTTP/2
TDC2016SP - Vamos falar sobre o futuro da web: HTTP/2TDC2016SP - Vamos falar sobre o futuro da web: HTTP/2
TDC2016SP - Vamos falar sobre o futuro da web: HTTP/2
 
[ETHCon Korea 2019] Shin mansun 신만선
[ETHCon Korea 2019] Shin mansun 신만선[ETHCon Korea 2019] Shin mansun 신만선
[ETHCon Korea 2019] Shin mansun 신만선
 
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin StożekJDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
 
Namespaces for Local Networks
Namespaces for Local NetworksNamespaces for Local Networks
Namespaces for Local Networks
 

Similar a Git Crash Course Brown Bag

Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - DeploymentFabio Akita
 
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Bosstmacwilliam
 
Website Performance Basics
Website Performance BasicsWebsite Performance Basics
Website Performance Basicsgeku
 
jclouds Support Training
jclouds Support Trainingjclouds Support Training
jclouds Support TrainingEverett Toews
 
DevOps for Opensource Geospatial Applications
DevOps for Opensource Geospatial ApplicationsDevOps for Opensource Geospatial Applications
DevOps for Opensource Geospatial Applicationstlpinney
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceForest Mars
 
Redis深入浅出
Redis深入浅出Redis深入浅出
Redis深入浅出ruoyi ruan
 
AtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingAtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingSteve Smith
 
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Fastly
 
Pragmatic Guide to Git
Pragmatic Guide to GitPragmatic Guide to Git
Pragmatic Guide to GitConFoo
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With GitNick Quaranto
 
marko_go_in_badoo
marko_go_in_badoomarko_go_in_badoo
marko_go_in_badooMarko Kevac
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with DockerDocker, Inc.
 

Similar a Git Crash Course Brown Bag (20)

Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Laravel Day / Deploy
Laravel Day / DeployLaravel Day / Deploy
Laravel Day / Deploy
 
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
 
Website Performance Basics
Website Performance BasicsWebsite Performance Basics
Website Performance Basics
 
Ansible - Crash course
Ansible - Crash courseAnsible - Crash course
Ansible - Crash course
 
jclouds Support Training
jclouds Support Trainingjclouds Support Training
jclouds Support Training
 
Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git Master
 
DevOps for Opensource Geospatial Applications
DevOps for Opensource Geospatial ApplicationsDevOps for Opensource Geospatial Applications
DevOps for Opensource Geospatial Applications
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSource
 
Redis深入浅出
Redis深入浅出Redis深入浅出
Redis深入浅出
 
GitLab on OpenShift
GitLab on OpenShiftGitLab on OpenShift
GitLab on OpenShift
 
AtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration trainingAtlasCamp 2015 Docker continuous integration training
AtlasCamp 2015 Docker continuous integration training
 
Loading...git
Loading...gitLoading...git
Loading...git
 
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
 
Deployment de Rails
Deployment de RailsDeployment de Rails
Deployment de Rails
 
Pragmatic Guide to Git
Pragmatic Guide to GitPragmatic Guide to Git
Pragmatic Guide to Git
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
marko_go_in_badoo
marko_go_in_badoomarko_go_in_badoo
marko_go_in_badoo
 
Git Basics Philips
Git Basics PhilipsGit Basics Philips
Git Basics Philips
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Último (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

Git Crash Course Brown Bag

  • 1. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Brown bag - Crash course From «I cloned», to «I push»
  • 2. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Agenda ● Presentation (20’) o Basic commands o Branching and merging o Git repositories and sharing code ● Q&A (5’) ● Quiz (5’)
  • 3. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Git setup $ git config --global user.name "FOO BAR" $ git config --global user.email foobar@acme.com
  • 4. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk The very beginning $ mkdir ccbb-git $ cd ccbb-git $ ll total 0 drwxr-xr-x 2 simo6545 1604020879 68 Feb 1 09:01 ./ drwxr-xr-x 117 simo6545 1604020879 3978 Feb 1 09:01 ../ local directory
  • 5. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Working directory $ git usage: git [--version] [--help] [-c name=value] [--exec-path[=<path>]] [--html-path] [--man-path] [--info- path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] <command> [<args>] The most commonly used git commands are: add Add file contents to the index bisect Find by binary search the change that introduced a bug branch List, create, or delete branches ...
  • 6. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Working directory - poking around $ echo 'The very beginning' > README $ git status fatal: Not a git repository (or any of the parent directories): .git $ ls -la total 8 drwxr-xr-x 3 simo6545 1604020879 102 Feb 1 09:28 . drwxr-xr-x 117 simo6545 1604020879 3978 Feb 1 09:01 .. -rw-r--r-- 1 simo6545 1604020879 19 Feb 1 09:28 README
  • 7. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Working directory - create repository $ git init Initialized empty Git repository in /Users/simo6545/tmp/20140201-090152/.git/ $ ll total 8 drwxr-xr-x 4 simo6545 1604020879 136 Feb 1 09:38 ./ drwxr-xr-x 117 simo6545 1604020879 3978 Feb 1 09:01 ../ drwxr-xr-x 9 simo6545 1604020879 306 Feb 1 09:39 .git/ -rw-r--r-- 1 simo6545 1604020879 19 Feb 1 09:28 README working directory
  • 8. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Working directory status $ git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # README nothing added to commit but untracked files present (use "git add" to track)
  • 9. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Staging area $ git status -s ?? README $ git add README $ git status -s A README stage changes
  • 10. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Staging area $ echo 'This is the second line.' >> README $ git status -s AM README $ git diff diff --git a/README b/README index 939d82f..9e92fed 100644 --- a/README +++ b/README @@ -1 +1,2 @@ The very beginning +This is the second line.
  • 11. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Staging area $ git add README $ git status -s A README Stage changes again: $ git diff
  • 12. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Commit to Git repository $ git commit -m 'First commit' [master (root-commit) 7c23e33] First commit 1 file changed, 2 insertions(+) create mode 100644 README $ git log commit 7c23e33b09b4863dbf59dbaec7bb023f7ff15c70 Author: Simone Soldateschi <simone.soldateschi@gmail.com> Date: Sat Feb 1 10:10:48 2014 +0000 First commit
  • 13. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Recap - The three states
  • 14. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Basic commands
  • 15. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Tagging $ git tag v0.1 $ git lg * 7c23e33 - (HEAD, tag: v0.1, master) First commit (63 minutes ago) $ echo 'Still working...' >> README $ git status -s M README $ git add README $ git status -s M README
  • 16. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Tagging $ git commit -m 'Second commit' [master a0a8c4b] Second commit 1 file changed, 1 insertion(+) $ git status -s $ git lg * a0a8c4b - (HEAD, master) Second commit (6 seconds ago) * 7c23e33 - (tag: v0.1) First commit (67 minutes ago) $ git tag v0.2 $ git lg * a0a8c4b - (HEAD, tag: v0.2, master) Second commit (6 seconds ago) * 7c23e33 - (tag: v0.1) First commit (67 minutes ago)
  • 17. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk File status lifecycle
  • 18. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Agenda ● Presentation (20’) o Basic commands o Branching and merging o Git repositories and sharing code ● Q&A (5’) ● Quiz (5’)
  • 19. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Branching $ git init Initialized empty Git repository in /Users/simo6545/tmp/20140201-090152/.git/ $ echo 'The first line' > README $ git add README $ git commit -m 'C0' [master (root-commit) 38e3df8] C0 1 file changed, 1 insertion(+) create mode 100644 README $ echo 'The second line' >> README $ git add README $ git commit -m 'C1' [master 836e142] C1 1 file changed, 1 insertion(+)
  • 20. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Branching
  • 21. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Branching $ echo 'Experimental line' >> README $ git add README $ git commit -m "C2" [experiment 18c3f30] C2 1 file changed, 1 insertion(+)
  • 22. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Branching
  • 23. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Branching
  • 24. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Branching
  • 25. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Branching
  • 26. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Branching
  • 27. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Merging
  • 28. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Merge conflict $ git merge experiment Auto-merging README CONFLICT (content): Merge conflict in README Automatic merge failed; fix conflicts and then commit the result. $ cat README The first line The second line <<<<<<< HEAD The third line ======= Experimental line Another experimental line The last experimental line >>>>>>> experiment
  • 29. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Merge conflict $ cat README The first line The second line The third line Experimental line Another experimental line The last experimental line $ git add README $ git commit -m ‘C6’
  • 30. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Rollback Current content of README: Look at repository logs: Rollback:
  • 31. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Rollback How does README look like? What about repository logs?
  • 32. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Checkout List branches (?!) Restore master
  • 33. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Agenda ● Presentation (20’) o Basic commands o Branching and merging o Git repositories and sharing code ● Q&A (5’) ● Quiz (5’)
  • 34. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Git repos & sharing code
  • 35. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Git repos & sharing code http://gitorious.org http://gna.org/projects/savane/
  • 36. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Git repos & sharing code ● remote ● clone ● pull ● push
  • 37. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Remote repository
  • 38. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Remote repository
  • 39. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Remote repository $ git remote origin $ git remote -v origin git@github.com:siso/ccbbgit.git (fetch) origin git@github.com:siso/ccbbgit.git (push)
  • 40. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Remote repository
  • 41. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk pull do stuff push
  • 42. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Remote repository - README.md $ cat > README.md << EOF # Git Crash Course - Brown Bag ## Paragraph 1 * **Lorem ipsum dolor sit amet**, consectetur adipiscing elit. Donec tempor justo vitae nisi condimentum, id lobortis turpis tincidunt. ## Paragraph 2 * Duis egestas arcu quis elit posuere, vel iaculis lacus lobortis. Duis ultricies sem in diam facilisis, eget blandit mi rutrum. EOF
  • 43. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Markdown Markdown cheatsheethttps://github.com/adam-p/markdown- here/wiki/Markdown-Cheatsheet
  • 44. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Remote repository - push $ git add README.md $ git commit -m 'first release' [master e0b1158] first release 1 file changed, 6 insertions(+) $ git push origin master Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 464 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To git@github.com:siso/ccbbgit.git 5df3dad..e0b1158 master -> master
  • 45. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Remote repository
  • 46. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk local actions and objects remote actions and objects
  • 47. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
  • 48. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk A successful branching model
  • 49. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Git aliases $ git config --global alias.b branch $ git config --global alias.lg log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative $ git config --global alias.serve !git daemon --reuseaddr --verbose --base- path=. --export-all ./.git $ git config --global alias.st status st
  • 50. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Agenda ● Presentation (20’) o Basic commands o Branching and merging o Git repositories and sharing code ● Q&A (5’) ● Quiz (5’)
  • 51. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk
  • 52. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Agenda ● Presentation (20’) o Basic commands o Branching and merging o Git repositories and sharing code ● Q&A (5’) ● Quiz (5’)
  • 53. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Quiz
  • 54. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Give your feedback!
  • 55. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk References Git SCMhttp://git-scm.com/ A Visual Git Referencehttp://marklodato.github.io/visual-git-guide/index- en.html Git Workflowshttps://www.atlassian.com/git/workflows
  • 56. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk Homework ● Replay examples ● commit result to GitHub ● send me a message
  • 57. RACKSPACE® HOSTING | WWW.RACKSPACE.COMsimone.soldateschi@rackspace.co.uk

Notas del editor

  1. Do a minimal set up for your Git environment
  2. You enter a directory. That directory is empty. For now, this is just a local directory!
  3. How do you turn a local directory into a working directory? You type git and get that output
  4. Create a file. Ask Git about the working directory… Git says this is not a working directory. There is no ‘.git’ directory.
  5. Create a repository: the local directory turns into a working directory.
  6. This is kinda verbose
  7. Add README file to staging are
  8. Add README file to staging are
  9. Add README file to staging are
  10. Add README file to staging are
  11. TODO: provide step-by-step examples on that
  12. For now do not care of the ‘detached HEAD’ state message
  13. It seems that there is no master anymore, but wait...
  14. submit a patch
  15. TODO - describe, streamline and exemplify
  16. Git aliases used in this presentation
  17. Please, give your feedback!