Upgrade to Pro — share decks privately, control downloads, hide ads and more …

git workshop 2013-05-23

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for Peter Lehmann Peter Lehmann
May 23, 2013
34

git workshop 2013-05-23

Avatar for Peter Lehmann

Peter Lehmann

May 23, 2013

Transcript

  1. What  is  git   •  Git  is  a  distribute  version

     control  system(dvcs)   •  "No  Single  master"   •  "work  offline"   •  A  new  flow   •  Installers:   – Win:  hDps://code.google.com/p/gitextensions/   – Mac:  xcode  command  line  tools   –   
  2. setup   •  user.name|email   •  Github   •  Default

     editor   •  SSH   •  Visual  merge/diff  tool    
  3. Ignore  files   •  .giPgnore  can  be  in  root  and

     any  sub  folder   •  Apply  from  folder  and  sub   •  PaDerns  are  regex  with  !  as  not  
  4. .giPgnore  sample     #  User-­‐specific  files   *.suo  

    *.user   *.sln.docstates     #  Build  results     [Dd]ebug/   [Rr]elease/   x64/   build/   [Bb]in/   [Oo]bj/  
  5. Git  aDributes   •  Help  git  about  file  types  

      •  Text/bin   •  Line  endings   •  Merge/diff  
  6. Sample  .gitaDributes   *.cs  text  eol=crlf  diff=csharp   *.csproj  text

     eol=crlf  merge=union   *.sln  text  eol=crlf  merge=union   *.config  text  eol=crlf   *.resx  text  eol=crlf  merge=union   *  text=auto  eol=crlf   *.sh  text=auto  eol=lf   *.exe  binary   *.dll  binary   *.png  binary   *.jpg  binary   *.nupkg  binary   *.pdb  binary   *.vsix  binary   *.xap  binary  
  7. Remotes     •   Why  fetch  over  pull   • 

     git  push  origin  :feat1   •  Git  push  origin  feat:feat    
  8. Ohh  did  I  do  that   •  Git  reset  -­‐-­‐hard

        •  Git  clean  -­‐xdf   •  Git  checkout  -­‐-­‐  <filepath>    
  9. Known  what  your  are  doing   •  Git  rebase  -­‐-­‐interacPve

      •  Git  reset  -­‐-­‐hard  <commit>   •  Git  push  -­‐f      
  10. Pps   •  Git  config  -­‐-­‐global  alias.lol  'log  -­‐-­‐oneline  –

    decorate  -­‐-­‐graph'   •  Git  config  -­‐-­‐global  alias.undo  'checkout  -­‐-­‐'   •  Git  push  .  <remote>/<branch>:<branch>   •  Git  update-­‐index  -­‐-­‐assume-­‐unchanged  <file>   •  Git  gc  -­‐-­‐aggressive  -­‐-­‐prune=now   •  Git  log  -­‐-­‐preDy="format:%h@%s%b"  -­‐-­‐abbrev-­‐ commit  {0}..{1}