Advanced git
October 20, 2019 · View on GitHub
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
- Commit often. How often and why?
- Branching for experiments and easy roll-back. Fail no fear!
- Oh shit, git! Undoing things.
mergevsrebase. Which is when.- Squash 'em all!
- Never, ever, ever rewrite history! Or?
- Conflict resolution. Peace!
- Collaboration work flows
- Issue Driven Development
Some topics above are really short, others take time for they are better comprehended when practising.
Materials
- How to Write a Git Commit Message
- At Learn git branching
refresh your skills:
- Main: Moving Work Around, Advanced Topics
- Remote: all exercises
- git flows
- A successful Git branching model @nvie
- Issues with "nvie" git-flow
- Understanding the GitHub flow
- Introduction to GitLab Flow
- git-flow vs github-flow vs gitlab-flow
- OneFlow - a Git branching model and workflow
- Comparing Workflows @Atlassian
- DM Development Workflow with Git, GitHub, JIRA and Jenkins
- Git Workflows for Pros: A Good Git Guide
- git automation tools:
- Advanced Git Tricks :clapper:
- Git Patterns and Anti-Patterns
- Oh shit, git!
- How to undo (almost) anything with Git
- Flight rules for git
- GitHub Learning Lab:
- Rebase techniques
- Merging repos & Repo import and export back
- How to publish
dist/*only on github pages - octotree // Chrome github navigation plug-in
- Скринкаст по git :clapper::clapper::clapper:
- A Visual Git Reference
- placeholder for workshop videocast
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 branchgit reset --mixed|soft|hardgit revert- cherry pick
merge/rebasemergevsrebasegit merge --no-ff branch- cherry picking
- what actually
rebaseis
- 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
mergevsrebase, 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-dirto publish- gists...
- Git Credentials Storage
- tags, releases
Video
You can watch related screencasts from Kottans course live workshops below.
![]() | Git Course Intro - Oleksiy Rudenko |
![]() | Git Workshop - Oleksiy Rudenko |

