Managing Complexity With Git Tricks

Managing Complexity With Git
* PLAN YOUR COMMITS AHEAD OF TIME / REPLAN IF YOU NEED TO
Have a road map to approach a problem (focus on gaining knowledge/reading code / talk to people)
  • USE SINGLE PURPOSE BRANCHES
    Notice when you are working something else than the purpose of the branch
    Notice when if a commit has value independent of the branch - CHERRY PICK onto master.
       git commit -m 'Wonderful Refactoring'
       git checkout <Develop_Branch>
       git cherry-pick <SHA OF Wonderful Refactoring / Branch Name when HEAD Commit>
       git checkout <Feature_Branch>
       git REBASE <Develop_Branch> --Rebase feature branch
  • MAKE ATOMIC COMMITS - CAN BE DEPLOYED INDEPENDENTLY (CHERRY-PICK)
    Use --patch option to split changes into multiple commits. select y/n on hunks
      git add -p     
      git add --patch
  • WRITE GOOD COMMIT MESSAGES
    Descriptive Commit messages and get the thoughts out of your head into the system
  • REWRITE YOUR HISTORY TO TELL A STORY - EARLY AND OFTEN
      git rebase --interactive master
    Opens a VIM editor, change the order of the commit. Reorder / Squash commits

Notes from This Original #SkillsCast ed.gr/bktqo

Comments

Popular posts from this blog

Nuget Restore fails after installing the VS 2019 Preview

I Find Bugs too Boring to Write – Deconstruct 2017 – Arlo Belshee

Using TestCategory with OpenCover and ReportGenerator with VSTest.console.exe