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

git tricks

git tricks

Small things that help the developer in everyday workflows. Presented at the git aficionados meetup.

Kai Howelmeyer

December 13, 2013
Tweet

More Decks by Kai Howelmeyer

Other Decks in Programming

Transcript

  1. git  config  -­‐-­‐global  -­‐-­‐add            

               alias.co  checkout       git  config  -­‐-­‐global  -­‐-­‐add                        alias.c  commit      
  2. #  On  branch  feature/kh-­‐pipelining   #  Changes  not  staged  for

     commit:   #      (use  "git  add  <file>..."  to  update  what  will  be  committed)   #      (use  "git  checkout  -­‐-­‐  <file>..."  to  discard  changes  in   #        working  directory)   #   #              modified:      src/lib/access/PipelineCollect.cpp   #              modified:      src/lib/access/PipelineStream.cpp   #              modified:      src/lib/access/system/ResponseTask.cpp   #   no  changes  added  to  commit     (use  "git  add"  and/or  "git  commit  -­‐a")  
  3.   git  add  –p     git  reset  –p  

      git  checkout  -­‐p  
  4. diff  -­‐-­‐git  a/src/lib/access/SimplePipeliningTableScan.h   b/src/lib/access/SimplePipeliningTableScan.h   index  8b7133e..0d80830  100644  

    -­‐-­‐-­‐  a/src/lib/access/SimplePipeliningTableScan.h   +++  b/src/lib/access/SimplePipeliningTableScan.h   @@  -­‐15,7  +15,7  @@  public:            void  setupPlanOperation();        void  executePlanOperation();   -­‐    static  a_planop_ptr  pares(const  Json::Value  &data);   +    static  a_planop_ptr  parse(const  Json::Value  &data);        void  setPredicate(SimpleExpression  *c);        private:  
  5. diff  -­‐-­‐git  a/src/lib/access/SimplePipeliningTableScan.h   b/src/lib/access/SimplePipeliningTableScan.h   index  4ca9b42..0d80830  100644  

    -­‐-­‐-­‐  a/src/lib/access/SimplePipeliningTableScan.h   +++  b/src/lib/access/SimplePipeliningTableScan.h   @@  -­‐15,7  +15,7  @@  public:      void  setupPlanOperation();    void  executePlanOperation();    static  a_planop_ptr  paresparse(const  Json::Value  &data);    void  setPredicate(SimpleExpression  *c);     private:    
  6. git  reset  c1   git  add   git  commit  

    c1   c2   c3   c4   HEAD   feature  
  7. feature squashing c1   c2   c3   c4  

    c(2+3+4)’     HEAD   feature  
  8.     git  bisect     C1   C2  

    C3   C4   C6   C7   C8  
  9.     git  bisect     C1   C2  

    C3   C4   C6   C7   C8   good bad
  10.     git  bisect     C1   C2  

    C3   C4   C6   C7   C8   good bad
  11.     git  bisect     C1   C2  

    C3   C4   C6   C7   C8   good bad good
  12.     git  bisect     C1   C2  

    C3   C4   C6   C7   C8   good bad good bad