Advanced git

October 20, 2019 · View on GitHub

MIT Licensed Awesome        Telegram

Advanced git

Enhance your git skills

This task is optional. You don't need it to advance further in the course. However, you will definitely apply newly acquired skills in your future work.

Pre-requisites

You already some have hands-on experience with:

  • creating, forking and cloning repos
  • committing changes
  • pulling, fetching and, hopefully, rebasing
  • basic branching
  • pushing to remotes
  • creating PR
  • collaborating with others and/or yourself :wink:

Basically, you have successfully completed this course entry task and git collaboration task

Topics

  1. Commit often. How often and why?
  2. Branching for experiments and easy roll-back. Fail no fear!
  3. Oh shit, git! Undoing things.
  4. merge vs rebase. Which is when.
  5. Squash 'em all!
  6. Never, ever, ever rewrite history! Or?
  7. Conflict resolution. Peace!
  8. Collaboration work flows
  9. Issue Driven Development

Some topics above are really short, others take time for they are better comprehended when practising.

Materials


Side notes

You don't need to read the notes below. These are rather a collection of possible theses.

TL;DR
  • Commit often
    • break your code base into smaller files
    • scope a commit to an individual file; may be 2+ files if a new module is introduced and immediately used/referred to elsewhere
    • think of collaboration and possible conflicts
  • Branching
    • branch, fail, checkout back
    • branch naming patterns; scoping using / delimiter
    • you may not need the branch after merger
    • specify the commit scope in a message; branches are just pointers
    • git stash
  • Undoing things
    • git branch
    • git reset --mixed|soft|hard
    • git revert
    • cherry pick
  • merge / rebase
    • merge vs rebase
    • git merge --no-ff branch
    • cherry picking
    • what actually rebase is
  • Squash 'em all!
    • keep issue references on squash/fixup
    • rebasing work flow
  • History rewriting
    • remote as a WIP storage
    • killing branches on remote
    • force pushing squashed
  • Conflict resolution
    • update from target branch before merging into it
    • merge vs rebase, hello again
    • cross check the result using diff with a back-up branch
  • Collaboration work flows
    • nvie, github, gitlab, fork-PR
    • tools: git-town, git aliases
    • shortcuts from JetBrains WebStorm
  • Issue Driven Development
    • add a feature/enhancement as an issue
    • refer to the issue on commit
    • issues as tasks in your IDE
  • Misc
    • git config/aliases collection
    • sub-tree, sub-repo
    • merging repos
    • push-dir to publish
    • gists...
    • Git Credentials Storage
    • tags, releases

Video

You can watch related screencasts from Kottans course live workshops below.

Git Course Intro - Oleksiy RudenkoGit Course Intro - Oleksiy Rudenko
Git Workshop - Oleksiy RudenkoGit Workshop - Oleksiy Rudenko