SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
Intro	
  to	
  Working	
  with	
  
GIT	
  and	
  GitHub	
  
By	
  Yakov	
  Fain	
  and	
  Viktor	
  Gamov	
  
Farata	
  Systems	
  	
  
www.faratasystems.com	
  
Centralized	
  file	
  repositories	
  
Mary	
  (dev)	
  
local	
  files	
  

Vlad	
  (dev)	
  
local	
  files	
  
Ravikumar	
  (QA)	
  
local	
  files	
  

Remote	
  Server	
  
a.k.a.	
  repository	
  
a.k.a.	
  repo	
  	
  

www.faratasystems.com	
  

• 
• 
• 
• 
• 

SVN	
  
CVS	
  
TFS	
  
Perforce	
  
…	
  
Centralized	
  file	
  repositories	
  
Mary	
  (dev)	
  
local	
  files	
  

Vlad	
  (dev)	
  
local	
  files	
  
Ravikumar	
  (QA)	
  
local	
  files	
  

Remote	
  Server	
  
a.k.a.	
  repository	
  
a.k.a.	
  repo	
  	
  

• 
• 
• 
• 
• 

SVN	
  
CVS	
  
TFS	
  
Perforce	
  
…	
  

Mary	
  commits	
  her	
  code	
  changes	
  to	
  the	
  remote	
  server	
  and	
  checks	
  out	
  Vlad’s	
  changes	
  
	
  
Vlad	
  commits	
  his	
  code	
  changes	
  to	
  the	
  remote	
  server	
  and	
  checks	
  out	
  Mary’s	
  changes	
  
	
  
Ravikumar	
  only	
  checks	
  out	
  the	
  code	
  for	
  the	
  QA	
  tesOng.	
  	
  
	
  
www.faratasystems.com	
  
Distributed	
  file	
  repositories	
  

•  GIT	
  
•  Mercurial	
  
•  Bazaar	
  

Mary	
  (dev),	
  local	
  files,	
  local	
  repo	
  

Vlad	
  (dev),	
  local	
  files,	
  local	
  repo	
  
Remote	
  Repo	
  
Ravikumar	
  (QA),	
  local	
  repo	
  
Each	
  developer	
  has	
  a	
  full	
  local	
  copy	
  of	
  the	
  repo.	
  
	
  
It’s	
  hard	
  to	
  lose	
  the	
  repository	
  –	
  it’s	
  on	
  every	
  user’s	
  computer.	
  
	
  
Each	
  user	
  always	
  works	
  with	
  the	
  local	
  repo	
  unOl	
  he	
  needs	
  to	
  synchronize.	
  
www.faratasystems.com	
  
Working	
  with	
  GIT	
  
•  `	
  

Mary	
  (dev),	
  local	
  files,	
  local	
  repo	
  

Vlad	
  (dev),	
  local	
  files,	
  local	
  repo	
  

pull/push	
  
pull	
  

Remote	
  Git	
  Repo,	
  
like	
  GitHub	
  
	
  

Ravikumar	
  (QA),	
  local	
  repo	
  
Mary	
  works	
  on	
  the	
  plane	
  and	
  commits	
  her	
  code	
  changes	
  to	
  the	
  local	
  repo	
  
	
  
Vlad	
  commits	
  his	
  code	
  changes	
  to	
  the	
  local	
  repo	
  and	
  pushes	
  latest	
  changes	
  to	
  the	
  remote	
  
repo)	
  
	
  
Ravikumar	
  works	
  for	
  QA.	
  He	
  pulls	
  out	
  the	
  code	
  for	
  tesOng.	
  	
  
www.faratasystems.com	
  
Sync	
  up	
  with	
  the	
  remote	
  server	
  
pull	
  
push	
  

Remote	
  Git	
  	
  
repository	
  	
  

Mary	
  landed.	
  She	
  goes	
  to	
  Starbucks	
  to	
  get	
  online	
  to	
  pull	
  Vlad’s	
  changes	
  to	
  her	
  local	
  repo	
  
and	
  push	
  hers	
  changes	
  to	
  the	
  remote	
  one.	
  
	
  

www.faratasystems.com	
  
git	
  add	
  

Staging	
  Area	
  

git	
  reset	
  
www.faratasystems.com	
  
git	
  commit	
  

Paying	
  for	
  groceries	
  
Is	
  a	
  commitment.	
  But	
  sOll,	
  	
  
you	
  have	
  a	
  chance	
  to	
  return	
  them	
  	
  

git	
  reset	
  –hard	
  HEAD~1	
  
www.faratasystems.com	
  
git	
  push	
  

www.faratasystems.com	
  
git	
  pull	
  

Pulls	
  are	
  usually	
  done	
  from	
  a	
  	
  remote	
  repository,	
  which	
  could	
  be	
  a	
  central	
  
server	
  or	
  another	
  user’s	
  refrigerator	
  computer.	
  
	
  
www.faratasystems.com	
  
Downloads	
  and	
  documentaOon	
  
•  hYp://git-­‐scm.com	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Git	
  	
  
•  hYps://help.github.com	
  	
  	
  	
  	
  	
  	
  GitHub	
  repo	
  
•  hYp://git-­‐scm.com/book	
  	
  	
  	
  	
  	
  Pro	
  Git	
  book	
  in	
  English	
  
•  hYp://git-­‐scm.com/book/ru	
  Pro	
  Git	
  book	
  in	
  Russian	
  
	
  
•  hYp://gitref.org	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Reference	
  manual	
  
MAC	
  users,	
  if	
  you	
  already	
  had	
  an	
  older	
  version	
  of	
  git	
  installed,	
  aer	
  installing	
  the	
  new	
  version	
  	
  
add	
  this	
  to	
  ~/.bash_profile:	
  
	
  
export	
  PATH=/usr/local/git/bin:$PATH	
  
www.faratasystems.com	
  
Seang	
  up	
  name	
  and	
  email	
  
•  git	
  config	
  -­‐-­‐global	
  user.name	
  ”Yakov	
  Fain"	
  	
  
	
  
•  git	
  config	
  -­‐-­‐global	
  user.email	
  
"yakovfain@gmail.com"	
  

www.faratasystems.com	
  
Two	
  Ways	
  of	
  CreaOng	
  a	
  New	
  Git	
  Repo	
  
1.  From	
  scratch	
  
	
  

	
  	
  	
  	
  a)	
  cd	
  to	
  a	
  directory	
  where	
  your	
  project	
  files	
  are	
  
	
  	
  	
  	
  b)	
  run	
  git	
  init	
  (this	
  will	
  create	
  .git	
  subdirectory)	
  
	
  

2.  Clone	
  the	
  exisOng	
  repo	
  from	
  somewhere,	
  e.g.	
  
from	
  GitHub,	
  for	
  example:	
  
	
  
git	
  clone	
  git://github.com/yfain/javatraining.git	
  

	
  
You	
  can	
  start	
  version-­‐controlling	
  any	
  directory	
  at	
  any	
  Ome.	
  Just	
  go	
  into	
  this	
  dir	
  from	
  the	
  	
  
command	
  line	
  and	
  run	
  git	
  init	
  there.	
  	
  
www.faratasystems.com	
  
Walkthrough	
  1:	
  git	
  init	
  	
  
1.  Go	
  to	
  a	
  Terminal	
  window	
  
	
  
2.  Create	
  an	
  empty	
  dir	
  temp1:	
  
mkdir	
  temp1	
  
	
  
3.  cd	
  temp1	
  
	
  
4.  Directory	
  is	
  empty	
  
ls	
  –la	
  
	
  
5.  Create	
  a	
  local	
  git	
  repo	
  
git	
  init	
  
	
  
6.  Note	
  a	
  new	
  subdir	
  .git	
  
ls	
  –la	
  
	
  
7.  See	
  the	
  structure	
  of	
  the	
  new	
  repo	
  
	
  tree	
  –a	
  	
  
	
  
There	
  is	
  no	
  logs	
  directory	
  yet.	
  
If	
  tree	
  command	
  doesn’t	
  work,	
  watch	
  this:	
  
The	
  objects	
  directrory	
  is	
  empty.	
  	
  	
  	
  
hYp://bit.ly/1bX2HqH	
  	
  	
  
This	
  is	
  your	
  enOre	
  new	
  Git	
  repo.	
  	
  	
  	
  	
   www.faratasystems.com	
  
You	
  can	
  start	
  version-­‐controlling	
  any	
  directory	
  at	
  
any	
  Ome.	
  	
  
	
  
Just	
  go	
  into	
  this	
  directory	
  from	
  the	
  command	
  line	
  
and	
  run	
  git	
  init	
  there.	
  	
  

www.faratasystems.com	
  
CreaOng	
  a	
  file	
  and	
  commiang	
  to	
  a	
  repo	
  
1.	
  Create	
  index.html:	
  


<html>"
<body bgcolor="red”>"
</body>"
</html>"
	
  
2.	
  Open	
  it	
  in	
  your	
  browser	
  –	
  it’s	
  red	
  
	
  
	
  
	
  
	
  
3.	
  git	
  status	
  
4.	
  git	
  add	
  .	
  
5.	
  git	
  commit	
  –m	
  “created	
  red	
  page”	
  
	
  
6.	
  Go	
  to	
  your	
  .git	
  directory.	
  	
  
	
  	
  	
  	
  	
  a)	
  You’ll	
  see	
  new	
  log	
  subdir	
  
	
  	
  	
  	
  	
  b)	
  Look	
  inside	
  your	
  objects	
  dir	
  

www.faratasystems.com	
  
Branching	
  	
  
•  The	
  default	
  branch	
  is	
  master	
  
git	
  branch	
  	
  
•  To	
  create	
  a	
  branch	
  named	
  blue	
  
git	
  branch	
  blue	
  
•  To	
  create	
  and	
  switch	
  to	
  branch	
  blue:	
  
	
  git	
  checkout	
  –b	
  blue	
  
	
  

•  To	
  switch	
  back	
  to	
  master:	
  
git	
  checkout	
  	
  master	
  
	
  
•  To	
  merge	
  blue	
  into	
  master:	
  
	
  	
  	
  	
  git	
  merge	
  blue	
  

www.faratasystems.com	
  
Walkthrough	
  2:	
  Adding	
  Another	
  Branch	
  
1.  Check	
  which	
  branch	
  are	
  you	
  in	
  (should	
  be	
  in	
  master)	
  
	
  	
  	
  	
  	
  	
  	
  git	
  branch	
  
	
  
2.	
  Create	
  a	
  new	
  branch	
  named	
  blue	
  and	
  switch	
  to	
  it:	
  
	
  	
  	
  	
  	
  	
  	
  git	
  checkout	
  –b	
  blue	
  
	
  
3.	
  Change	
  the	
  background	
  in	
  index.html	
  to	
  be	
  blue:	
  
<body bgcolor=”blue">"
	
  Open	
  index.html	
  in	
  the	
  browser	
  –	
  background	
  should	
  be	
  blue 

"
4.	
  Commit	
  the	
  change	
  
	
  	
  	
  	
  git	
  add	
  .	
  
	
  	
  	
  	
  git	
  commit	
  –m	
  “changing	
  background	
  from	
  red	
  to	
  blue”	
  
	
  
5.	
  Switch	
  back	
  to	
  the	
  branch	
  master	
  
	
  	
  	
  	
  git	
  checkout	
  master	
  
	
  
6.	
  Open	
  index.html	
  in	
  your	
  browser	
  –	
  background	
  should	
  be	
  red.	
  	
  
Check	
  your	
  working	
  directory	
  –	
  there	
  is	
  only	
  one	
  version	
  of	
  index.html.	
  
www.faratasystems.com	
  
Walkthrough	
  3:	
  One	
  more	
  branch	
  +	
  merging	
  
1.  Create	
  and	
  switch	
  one	
  more	
  branch	
  called	
  branch2	
  
git	
  checkout	
  –b	
  branch2	
  
	
  
2.  Add	
  some	
  text	
  inside	
  the	
  <body>	
  tag	
  in	
  index.html:	
  
<h1>Hello	
  from	
  branch2</h1>	
  
	
  
Open	
  index.html	
  in	
  the	
  Web	
  browser	
  
	
  
3.  Commit	
  the	
  change:	
  
git	
  add	
  .	
  
git	
  commit	
  –m	
  “added	
  some	
  text	
  to	
  the	
  page”	
  
	
  
4.  Switch	
  back	
  to	
  master	
  branch	
  
git	
  checkout	
  master	
  
	
  
Open	
  index.html	
  –	
  it’s	
  red	
  and	
  no	
  text	
  
	
  
5.  Merge	
  with	
  branch2	
  
git	
  merge	
  branch2	
  
Open	
  index.html	
  –	
  it’s	
  red	
  with	
  text	
  
www.faratasystems.com	
  
Walkthrough	
  3:	
  Merge	
  conflict	
  
Merging	
  master	
  with	
  blue	
  will	
  cause	
  
the	
  conflict.	
  	
  
Master	
  branch	
  has	
  
	
  <body	
  bgcolor="red">	
  
Blue	
  branch	
  has	
  	
  
<body	
  bgcolor=”blue”>	
  
	
  
	
  
Open	
  index.html	
  in	
  the	
  editor	
  and	
  
manually	
  change	
  it	
  to	
  keep	
  the	
  line	
  
with	
  blue	
  color.	
  	
  
	
  
The	
  final	
  version	
  of	
  index.html:	
  
	
  
<html>	
  
	
  	
  <body	
  bgcolor="blue">	
  
	
  	
  	
  	
  	
  	
  <h1>Hello	
  from	
  branch2</h1>	
  
	
  	
  </body>	
  
</html>	
  	
  
	
  
Do	
  git	
  add	
  .	
  and	
  git	
  commit	
  	
  	
  

www.faratasystems.com	
  
Git	
  config	
  files	
  
Global	
  Git	
  Config:	
  	
  	
  
~/.gitconfig	
  
	
  
Local	
  Git	
  Config:	
  
	
  your_project_dir/.git/config	
  

www.faratasystems.com	
  
GitHub:	
  	
  HosOng	
  for	
  Git	
  

Note:	
  Bitbucket.org	
  is	
  another	
  hosOng	
  service	
  for	
  Git	
  repositories.	
  
	
  
Pricing:	
  hYps://bitbucket.org/account/user/yfain/plans/	
  	
  
www.faratasystems.com	
  
GitHub	
  –	
  Online	
  Project	
  HosOng	
  For	
  Git	
  
To	
  start	
  using	
  GitHub	
  create	
  an	
  account	
  there.	
  	
  
	
  
You	
  can	
  create	
  an	
  organizaOon	
  and	
  add	
  users	
  to	
  
the	
  organizaOon.	
  
	
  

www.faratasystems.com	
  
Create	
  New	
  Repository	
  on	
  GitHub	
  	
  

1.  Login	
  to	
  your	
  Github	
  account	
  
2.  Select	
  the	
  tab	
  Repositories	
  and	
  create	
  new	
  
Repository	
  	
  
3.  Enter	
  the	
  name	
  of	
  the	
  project	
  and	
  its	
  
descripOon.	
  
www.faratasystems.com	
  
Publishing	
  Your	
  Local	
  Project	
  to	
  GitHub	
  
Aer	
  the	
  repository	
  is	
  created	
  you’ll	
  see	
  commands	
  to	
  run	
  from	
  
your	
  desktop.	
  Say,	
  you	
  named	
  the	
  repo	
  temp1:	
  

Open	
  command	
  or	
  Terminal	
  window,	
  switch	
  to	
  temp1	
  and	
  enter	
  
the	
  above	
  commands.	
  
For	
  more	
  details	
  read	
  this:	
  
hYps://help.github.com/arOcles/create-­‐a-­‐repo	
  	
  
www.faratasystems.com	
  
Downloading	
  ExisOng	
  Repo	
  from	
  GitHub	
  
Either	
  click	
  on	
  the	
  buYon	
  Clone	
  in	
  Desktop	
  
	
  
	
  or	
  	
  
	
  
download	
  the	
  repo	
  as	
  zip.	
  
	
  

To	
  clone	
  from	
  a	
  command	
  line	
  you	
  need	
  to	
  know	
  the	
  URL	
  of	
  the	
  repo,	
  for	
  example:	
  	
  
	
  
git	
  clone	
  git://github.com/johnsmith/mygreatprograms.git	
  
	
  
or	
  
	
  
git	
  clone	
  hYps://github.com/johnsmith/mygreatprograms	
  
www.faratasystems.com	
  
What’s	
  Pull	
  Request	
  
•  The	
  user	
  Viktor,	
  who	
  doesn’t	
  belong	
  to	
  our	
  project	
  can	
  
fork	
  the	
  proj,	
  make	
  the	
  changes	
  and	
  send	
  a	
  Pull	
  
Request.	
  
	
  
•  If	
  Yakov	
  agrees	
  to	
  the	
  pull	
  request	
  he	
  pulls	
  the	
  change	
  
from	
  Viktor’s	
  repo	
  to	
  ours	
  –	
  he	
  goes	
  to	
  Pull	
  Requests	
  
and	
  selects	
  Merge	
  Pull	
  Request.	
  

www.faratasystems.com	
  
GitHub	
  Fork	
  
Fork	
  
Yakov’s	
  
Github	
  Repo	
  

Pull	
  Request	
  

pull,	
  push	
  

pull,	
  push	
  

Yakov’s	
  
Desktop	
  

Viktor’s	
  
Github	
  Repo	
  

pull,	
  push	
  

www.faratasystems.com	
  

Viktor’s	
  
Desktop	
  
Merging	
  Pull	
  Request	
  Sample	
  1	
  

www.faratasystems.com	
  
Merging	
  Pull	
  Request	
  Sample	
  2	
  

www.faratasystems.com	
  
Contact	
  Info	
  
•  yfain@faratasystems.com	
  
•  viktor.gamov@faratasystems.com	
  	
  
•  @yfain	
  	
  
•  @gAmUssA	
  

www.faratasystems.com	
  

Weitere ähnliche Inhalte

Was ist angesagt?

Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginningJames Aylett
 
Git hub ppt presentation
Git hub ppt presentationGit hub ppt presentation
Git hub ppt presentationAyanaRukasar
 
Git: from Novice to Expert
Git: from Novice to ExpertGit: from Novice to Expert
Git: from Novice to ExpertGoddy Zhao
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
 
Git Terminologies
Git TerminologiesGit Terminologies
Git TerminologiesYash
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon MelbournePaal Ringstad
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHubUri Goldstein
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messesKatie Sylor-Miller
 
Git-ing out of your git messes - Fluent Conf 2017
Git-ing out of  your git messes - Fluent Conf 2017Git-ing out of  your git messes - Fluent Conf 2017
Git-ing out of your git messes - Fluent Conf 2017Katie Sylor-Miller
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitE Carter
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubKim Moir
 
Git and GitHub at the San Francisco JUG
 Git and GitHub at the San Francisco JUG Git and GitHub at the San Francisco JUG
Git and GitHub at the San Francisco JUGMatthew McCullough
 

Was ist angesagt? (20)

Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
 
Git hub ppt presentation
Git hub ppt presentationGit hub ppt presentation
Git hub ppt presentation
 
Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
 
Git: from Novice to Expert
Git: from Novice to ExpertGit: from Novice to Expert
Git: from Novice to Expert
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
Git Terminologies
Git TerminologiesGit Terminologies
Git Terminologies
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon Melbourne
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
 
Git-ing out of your git messes - Fluent Conf 2017
Git-ing out of  your git messes - Fluent Conf 2017Git-ing out of  your git messes - Fluent Conf 2017
Git-ing out of your git messes - Fluent Conf 2017
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Switching to Git
Switching to GitSwitching to Git
Switching to Git
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
 
git and github
git and githubgit and github
git and github
 
Git and GitHub at the San Francisco JUG
 Git and GitHub at the San Francisco JUG Git and GitHub at the San Francisco JUG
Git and GitHub at the San Francisco JUG
 

Andere mochten auch

La Evolucion Del Hombre
La Evolucion Del HombreLa Evolucion Del Hombre
La Evolucion Del HombreAuro Sago
 
Running a Virtual Company
Running a Virtual CompanyRunning a Virtual Company
Running a Virtual CompanyYakov Fain
 
不自然なcar/ナチュラルにconsして
不自然なcar/ナチュラルにconsして不自然なcar/ナチュラルにconsして
不自然なcar/ナチュラルにconsしてmitsutaka mimura
 
Vortrag Veen 19 09 2005
Vortrag  Veen 19 09 2005Vortrag  Veen 19 09 2005
Vortrag Veen 19 09 2005guest9200b6
 
Net Generation Learning
Net Generation LearningNet Generation Learning
Net Generation Learningguest9200b6
 
Force.com Migration Tool
Force.com Migration ToolForce.com Migration Tool
Force.com Migration ToolAtul Gupta(8X)
 
Scripted Data Loads with Salesforce DataLoader and ANT
Scripted Data Loads with Salesforce DataLoader and ANTScripted Data Loads with Salesforce DataLoader and ANT
Scripted Data Loads with Salesforce DataLoader and ANTSalesforce Developers
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web ApplicationYakov Fain
 

Andere mochten auch (10)

La Evolucion Del Hombre
La Evolucion Del HombreLa Evolucion Del Hombre
La Evolucion Del Hombre
 
Running a Virtual Company
Running a Virtual CompanyRunning a Virtual Company
Running a Virtual Company
 
不自然なcar/ナチュラルにconsして
不自然なcar/ナチュラルにconsして不自然なcar/ナチュラルにconsして
不自然なcar/ナチュラルにconsして
 
Vortrag Veen 19 09 2005
Vortrag  Veen 19 09 2005Vortrag  Veen 19 09 2005
Vortrag Veen 19 09 2005
 
Net Generation Learning
Net Generation LearningNet Generation Learning
Net Generation Learning
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Force.com Migration Tool
Force.com Migration ToolForce.com Migration Tool
Force.com Migration Tool
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Scripted Data Loads with Salesforce DataLoader and ANT
Scripted Data Loads with Salesforce DataLoader and ANTScripted Data Loads with Salesforce DataLoader and ANT
Scripted Data Loads with Salesforce DataLoader and ANT
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 

Ähnlich wie Princeton jug git_github

Git walkthrough
Git walkthroughGit walkthrough
Git walkthroughBimal Jain
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideRaghavendraVattikuti1
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Git workflow libre semikov
Git workflow libre semikovGit workflow libre semikov
Git workflow libre semikovInna Kravchenko
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for ArtistsDavid Newbury
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubBigBlueHat
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshopthemystic_ca
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsChris Bohatka
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlBecky Todd
 

Ähnlich wie Princeton jug git_github (20)

簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Git basic
Git basicGit basic
Git basic
 
Git workflow libre semikov
Git workflow libre semikovGit workflow libre semikov
Git workflow libre semikov
 
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
sample.pptx
sample.pptxsample.pptx
sample.pptx
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
Git training v10
Git training v10Git training v10
Git training v10
 
git.ppt.pdf
git.ppt.pdfgit.ppt.pdf
git.ppt.pdf
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
 

Mehr von Yakov Fain

Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020Yakov Fain
 
Web sockets in Angular
Web sockets in AngularWeb sockets in Angular
Web sockets in AngularYakov Fain
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsYakov Fain
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsYakov Fain
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java DevelopersYakov Fain
 
Reactive Streams and RxJava2
Reactive Streams and RxJava2Reactive Streams and RxJava2
Reactive Streams and RxJava2Yakov Fain
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsYakov Fain
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java DevelopersYakov Fain
 
Reactive programming in Angular 2
Reactive programming in Angular 2Reactive programming in Angular 2
Reactive programming in Angular 2Yakov Fain
 
Reactive Thinking in Java with RxJava2
Reactive Thinking in Java with RxJava2Reactive Thinking in Java with RxJava2
Reactive Thinking in Java with RxJava2Yakov Fain
 
Angular2 Development for Java developers
Angular2 Development for Java developersAngular2 Development for Java developers
Angular2 Development for Java developersYakov Fain
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in JavaYakov Fain
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java DevelopersYakov Fain
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework Yakov Fain
 
Dart for Java Developers
Dart for Java DevelopersDart for Java Developers
Dart for Java DevelopersYakov Fain
 
RESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTRESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTYakov Fain
 
Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowYakov Fain
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScriptYakov Fain
 
Java Intro: Unit1. Hello World
Java Intro: Unit1. Hello WorldJava Intro: Unit1. Hello World
Java Intro: Unit1. Hello WorldYakov Fain
 
Speed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsSpeed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsYakov Fain
 

Mehr von Yakov Fain (20)

Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020
 
Web sockets in Angular
Web sockets in AngularWeb sockets in Angular
Web sockets in Angular
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
 
Using JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot appsUsing JHipster for generating Angular/Spring Boot apps
Using JHipster for generating Angular/Spring Boot apps
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 
Reactive Streams and RxJava2
Reactive Streams and RxJava2Reactive Streams and RxJava2
Reactive Streams and RxJava2
 
Using JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot appsUsing JHipster 4 for generating Angular/Spring Boot apps
Using JHipster 4 for generating Angular/Spring Boot apps
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java Developers
 
Reactive programming in Angular 2
Reactive programming in Angular 2Reactive programming in Angular 2
Reactive programming in Angular 2
 
Reactive Thinking in Java with RxJava2
Reactive Thinking in Java with RxJava2Reactive Thinking in Java with RxJava2
Reactive Thinking in Java with RxJava2
 
Angular2 Development for Java developers
Angular2 Development for Java developersAngular2 Development for Java developers
Angular2 Development for Java developers
 
Reactive Thinking in Java
Reactive Thinking in JavaReactive Thinking in Java
Reactive Thinking in Java
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java Developers
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Dart for Java Developers
Dart for Java DevelopersDart for Java Developers
Dart for Java Developers
 
RESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoTRESTful services and OAUTH protocol in IoT
RESTful services and OAUTH protocol in IoT
 
Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business Workflow
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Java Intro: Unit1. Hello World
Java Intro: Unit1. Hello WorldJava Intro: Unit1. Hello World
Java Intro: Unit1. Hello World
 
Speed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSocketsSpeed up your Web applications with HTML5 WebSockets
Speed up your Web applications with HTML5 WebSockets
 

Kürzlich hochgeladen

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Kürzlich hochgeladen (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Princeton jug git_github

  • 1. Intro  to  Working  with   GIT  and  GitHub   By  Yakov  Fain  and  Viktor  Gamov   Farata  Systems     www.faratasystems.com  
  • 2. Centralized  file  repositories   Mary  (dev)   local  files   Vlad  (dev)   local  files   Ravikumar  (QA)   local  files   Remote  Server   a.k.a.  repository   a.k.a.  repo     www.faratasystems.com   •  •  •  •  •  SVN   CVS   TFS   Perforce   …  
  • 3. Centralized  file  repositories   Mary  (dev)   local  files   Vlad  (dev)   local  files   Ravikumar  (QA)   local  files   Remote  Server   a.k.a.  repository   a.k.a.  repo     •  •  •  •  •  SVN   CVS   TFS   Perforce   …   Mary  commits  her  code  changes  to  the  remote  server  and  checks  out  Vlad’s  changes     Vlad  commits  his  code  changes  to  the  remote  server  and  checks  out  Mary’s  changes     Ravikumar  only  checks  out  the  code  for  the  QA  tesOng.       www.faratasystems.com  
  • 4. Distributed  file  repositories   •  GIT   •  Mercurial   •  Bazaar   Mary  (dev),  local  files,  local  repo   Vlad  (dev),  local  files,  local  repo   Remote  Repo   Ravikumar  (QA),  local  repo   Each  developer  has  a  full  local  copy  of  the  repo.     It’s  hard  to  lose  the  repository  –  it’s  on  every  user’s  computer.     Each  user  always  works  with  the  local  repo  unOl  he  needs  to  synchronize.   www.faratasystems.com  
  • 5. Working  with  GIT   •  `   Mary  (dev),  local  files,  local  repo   Vlad  (dev),  local  files,  local  repo   pull/push   pull   Remote  Git  Repo,   like  GitHub     Ravikumar  (QA),  local  repo   Mary  works  on  the  plane  and  commits  her  code  changes  to  the  local  repo     Vlad  commits  his  code  changes  to  the  local  repo  and  pushes  latest  changes  to  the  remote   repo)     Ravikumar  works  for  QA.  He  pulls  out  the  code  for  tesOng.     www.faratasystems.com  
  • 6. Sync  up  with  the  remote  server   pull   push   Remote  Git     repository     Mary  landed.  She  goes  to  Starbucks  to  get  online  to  pull  Vlad’s  changes  to  her  local  repo   and  push  hers  changes  to  the  remote  one.     www.faratasystems.com  
  • 7. git  add   Staging  Area   git  reset   www.faratasystems.com  
  • 8. git  commit   Paying  for  groceries   Is  a  commitment.  But  sOll,     you  have  a  chance  to  return  them     git  reset  –hard  HEAD~1   www.faratasystems.com  
  • 10. git  pull   Pulls  are  usually  done  from  a    remote  repository,  which  could  be  a  central   server  or  another  user’s  refrigerator  computer.     www.faratasystems.com  
  • 11. Downloads  and  documentaOon   •  hYp://git-­‐scm.com                                Git     •  hYps://help.github.com              GitHub  repo   •  hYp://git-­‐scm.com/book            Pro  Git  book  in  English   •  hYp://git-­‐scm.com/book/ru  Pro  Git  book  in  Russian     •  hYp://gitref.org                                              Reference  manual   MAC  users,  if  you  already  had  an  older  version  of  git  installed,  aer  installing  the  new  version     add  this  to  ~/.bash_profile:     export  PATH=/usr/local/git/bin:$PATH   www.faratasystems.com  
  • 12. Seang  up  name  and  email   •  git  config  -­‐-­‐global  user.name  ”Yakov  Fain"       •  git  config  -­‐-­‐global  user.email   "yakovfain@gmail.com"   www.faratasystems.com  
  • 13. Two  Ways  of  CreaOng  a  New  Git  Repo   1.  From  scratch            a)  cd  to  a  directory  where  your  project  files  are          b)  run  git  init  (this  will  create  .git  subdirectory)     2.  Clone  the  exisOng  repo  from  somewhere,  e.g.   from  GitHub,  for  example:     git  clone  git://github.com/yfain/javatraining.git     You  can  start  version-­‐controlling  any  directory  at  any  Ome.  Just  go  into  this  dir  from  the     command  line  and  run  git  init  there.     www.faratasystems.com  
  • 14. Walkthrough  1:  git  init     1.  Go  to  a  Terminal  window     2.  Create  an  empty  dir  temp1:   mkdir  temp1     3.  cd  temp1     4.  Directory  is  empty   ls  –la     5.  Create  a  local  git  repo   git  init     6.  Note  a  new  subdir  .git   ls  –la     7.  See  the  structure  of  the  new  repo    tree  –a       There  is  no  logs  directory  yet.   If  tree  command  doesn’t  work,  watch  this:   The  objects  directrory  is  empty.         hYp://bit.ly/1bX2HqH       This  is  your  enOre  new  Git  repo.           www.faratasystems.com  
  • 15. You  can  start  version-­‐controlling  any  directory  at   any  Ome.       Just  go  into  this  directory  from  the  command  line   and  run  git  init  there.     www.faratasystems.com  
  • 16. CreaOng  a  file  and  commiang  to  a  repo   1.  Create  index.html:   
 <html>" <body bgcolor="red”>" </body>" </html>"   2.  Open  it  in  your  browser  –  it’s  red           3.  git  status   4.  git  add  .   5.  git  commit  –m  “created  red  page”     6.  Go  to  your  .git  directory.              a)  You’ll  see  new  log  subdir            b)  Look  inside  your  objects  dir   www.faratasystems.com  
  • 17. Branching     •  The  default  branch  is  master   git  branch     •  To  create  a  branch  named  blue   git  branch  blue   •  To  create  and  switch  to  branch  blue:    git  checkout  –b  blue     •  To  switch  back  to  master:   git  checkout    master     •  To  merge  blue  into  master:          git  merge  blue   www.faratasystems.com  
  • 18. Walkthrough  2:  Adding  Another  Branch   1.  Check  which  branch  are  you  in  (should  be  in  master)                git  branch     2.  Create  a  new  branch  named  blue  and  switch  to  it:                git  checkout  –b  blue     3.  Change  the  background  in  index.html  to  be  blue:   <body bgcolor=”blue">"  Open  index.html  in  the  browser  –  background  should  be  blue 
 " 4.  Commit  the  change          git  add  .          git  commit  –m  “changing  background  from  red  to  blue”     5.  Switch  back  to  the  branch  master          git  checkout  master     6.  Open  index.html  in  your  browser  –  background  should  be  red.     Check  your  working  directory  –  there  is  only  one  version  of  index.html.   www.faratasystems.com  
  • 19. Walkthrough  3:  One  more  branch  +  merging   1.  Create  and  switch  one  more  branch  called  branch2   git  checkout  –b  branch2     2.  Add  some  text  inside  the  <body>  tag  in  index.html:   <h1>Hello  from  branch2</h1>     Open  index.html  in  the  Web  browser     3.  Commit  the  change:   git  add  .   git  commit  –m  “added  some  text  to  the  page”     4.  Switch  back  to  master  branch   git  checkout  master     Open  index.html  –  it’s  red  and  no  text     5.  Merge  with  branch2   git  merge  branch2   Open  index.html  –  it’s  red  with  text   www.faratasystems.com  
  • 20. Walkthrough  3:  Merge  conflict   Merging  master  with  blue  will  cause   the  conflict.     Master  branch  has    <body  bgcolor="red">   Blue  branch  has     <body  bgcolor=”blue”>       Open  index.html  in  the  editor  and   manually  change  it  to  keep  the  line   with  blue  color.       The  final  version  of  index.html:     <html>      <body  bgcolor="blue">              <h1>Hello  from  branch2</h1>      </body>   </html>       Do  git  add  .  and  git  commit       www.faratasystems.com  
  • 21. Git  config  files   Global  Git  Config:       ~/.gitconfig     Local  Git  Config:    your_project_dir/.git/config   www.faratasystems.com  
  • 22. GitHub:    HosOng  for  Git   Note:  Bitbucket.org  is  another  hosOng  service  for  Git  repositories.     Pricing:  hYps://bitbucket.org/account/user/yfain/plans/     www.faratasystems.com  
  • 23. GitHub  –  Online  Project  HosOng  For  Git   To  start  using  GitHub  create  an  account  there.       You  can  create  an  organizaOon  and  add  users  to   the  organizaOon.     www.faratasystems.com  
  • 24. Create  New  Repository  on  GitHub     1.  Login  to  your  Github  account   2.  Select  the  tab  Repositories  and  create  new   Repository     3.  Enter  the  name  of  the  project  and  its   descripOon.   www.faratasystems.com  
  • 25. Publishing  Your  Local  Project  to  GitHub   Aer  the  repository  is  created  you’ll  see  commands  to  run  from   your  desktop.  Say,  you  named  the  repo  temp1:   Open  command  or  Terminal  window,  switch  to  temp1  and  enter   the  above  commands.   For  more  details  read  this:   hYps://help.github.com/arOcles/create-­‐a-­‐repo     www.faratasystems.com  
  • 26. Downloading  ExisOng  Repo  from  GitHub   Either  click  on  the  buYon  Clone  in  Desktop      or       download  the  repo  as  zip.     To  clone  from  a  command  line  you  need  to  know  the  URL  of  the  repo,  for  example:       git  clone  git://github.com/johnsmith/mygreatprograms.git     or     git  clone  hYps://github.com/johnsmith/mygreatprograms   www.faratasystems.com  
  • 27. What’s  Pull  Request   •  The  user  Viktor,  who  doesn’t  belong  to  our  project  can   fork  the  proj,  make  the  changes  and  send  a  Pull   Request.     •  If  Yakov  agrees  to  the  pull  request  he  pulls  the  change   from  Viktor’s  repo  to  ours  –  he  goes  to  Pull  Requests   and  selects  Merge  Pull  Request.   www.faratasystems.com  
  • 28. GitHub  Fork   Fork   Yakov’s   Github  Repo   Pull  Request   pull,  push   pull,  push   Yakov’s   Desktop   Viktor’s   Github  Repo   pull,  push   www.faratasystems.com   Viktor’s   Desktop  
  • 29. Merging  Pull  Request  Sample  1   www.faratasystems.com  
  • 30. Merging  Pull  Request  Sample  2   www.faratasystems.com  
  • 31. Contact  Info   •  yfain@faratasystems.com   •  viktor.gamov@faratasystems.com     •  @yfain     •  @gAmUssA   www.faratasystems.com