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

Git Lesson

Git Lesson

Things try to avoid at GitHub. Rule of thumb when you are using Git.

Oursky Limited

November 22, 2011
Tweet

More Decks by Oursky Limited

Other Decks in Programming

Transcript

  1. GitHub Model Fork and branch Make changes Pull Request Integration

    Manager Workflow Tuesday, 22 November, 11
  2. git merge Merge hell Don’t merge at pull request. Don’t

    reuse branch. New Branch or Rebase! Tuesday, 22 November, 11
  3. git rebase Rebase will kill the history. I appear so

    productive at 15 Nov! Some issue tracker will go crazy.... Rebase public branch? Tuesday, 22 November, 11
  4. Remove password! git filter-branch --index-filter 'git rm --cached --ignore-unmatch Rakefile'

    HEAD git push origin master --force All branch must be rebase! github will cached the password, open a support ticket.... Tuesday, 22 November, 11
  5. Revert merge ---o---o---o---M---x---x---W / ---A---B ---o---o---o---M---x---x---W---x / ---A---B-------------------C---D A and

    B are bad, use “git revert -m 1 M”(W) to revert C and D fix the bugs introduced by A and B. Tuesday, 22 November, 11
  6. Two way Revert W Redo A B ---o---o---o---M---x---x-------x-------* / /

    ---A---B-------------------C---D ---o---o---o---M---x---x---W---x---x---Y---* / \ / ---A---B A'--B'--C' Tuesday, 22 November, 11
  7. Consideration Try no to reverting too much Small commit is

    easier for bisect Revert a commit, not a merge. Linus on merge: ftp://82.96.64.7/pub/software/scm/git/ docs/v1.6.3.3/howto/revert-a-faulty-merge.txt Tuesday, 22 November, 11