- All 159 git sub-commands
- All possible git workflows
- Best practices
- init, clone, status, diff, add, commit, log, blame, branch, tag, fetch, pull, push, merge
- Not going to talk about these
- remote, rebase, revert
- Not going to talk about these either
- There's more to it that just checking out a branch/tag.
- If you want to cleanly undo changes to a file:
git checkout -- <path-to-file>
- Another undo; this time, wipe out all changes in the working tree:
git reset --hard HEAD
- Like Posix mv, rename or move a file. Difference? Git will be able to track the change.
- If you use the Posix mv, git may see the change as a deleted file and a new file. Sometimes it can work it out and sometimes it can't. Use git mv.
Please.
- Clone a repository
- Change the code
- Commit the changes
- Push the commit
- Party
Dude
- Clone a repository
- Make a change
- Commit your changes
- Attempt to push to the repository (fail)
- Pull current from repository
- Fix all conflicts
- Commit fixed conflicts
- Attempt to push to the repository (fail)
- Pull current from repository
- Fix new conflicts
- Commit fixed conflicts
- Attempt to push to the repository (fail)
- Quiz: what happens next?
- Fork repository (or clone repository)
- Create a branch
- Make changes
- Commit the changes
- Push the changes to your branch repository
- Submit a pull request
- Enjoy the sound of crickets
- If receive notice that pull request was accepted:
- Else
- Mutter incoherently and try again (or not)
- Commit === related changes
- Small commits === goodness
- Frequent commits === goodness
- Half-done commits === badness
- Test before commit === goodness
- 3 commits to fix earlier commits === badness
- Proper commit messages === goodness
- Summary (<=50 chars) + Longer description if necessary
- Git is not a backup system
- If you need a backup system, get a backup system
- Branches === Goodness/Badness
- Long-lived branches === Badness
- Or at least Uncomfortableness
- Feature branches === Goodness
- Be mindful of your surroundings
- If you are contemplating an earth-shattering change in an area you KNOW others are working in, stop, communicate and perhaps defer the change to a later date.
- 50,000 merge-conflict related assaults could have been avoided in America last year if there had been just a little bit of communication.
- Git is like a playground: if you don't agree on the workflow (rules) up front, you're going to have hair-pulling and general unpleasantness.
- A trip to the principal's office won't fix this - you must have well-defined rules.
Made with Slides.com