GithubHelp home page GithubHelp logo

git-gud's Introduction

Hello!

This is the workshop repository for the Git Gud Quick workshop for Opswerks Converge 2018.

Click me

Outline

  • Git Gud Quick
    • An interactive quickstart guide to git
  • Introduction
    • Bad joke time
    • Hi, I'm new here
  • Workshop goals
    • From zero to git working
    • Learn how to fork, commit, branch, push, PR, pull
  • Expectations and assumptions
    • Comfortable working with a shell
    • A public GitHub account
    • SSH key associated with your GitHub account
    • Not going to talk about other DVCS like Mercurial
  • Introduction to Git
  • Workshop proper
    • Fork me!
    • Let's get started
    • Fork and pull workflow
      • You copy the repository to your account
      • Work on your copy
      • Commit and push to yours
      • File a pull request for integration
    • First commits
      • Create a file with some content something unique like last thing you searched for, or your password
      • git add <file>
      • git commit and write a commit message
    • Check out this branch
      • git branch devel
      • git branch
      • git checkout devel
      • Make a new file, delete previous, and commit again
      • git checkout master
      • Shortcut: git checkout -b devel
    • Branches
      • Other states of code, internal fork of your repository
      • Common use cases: master/devel, experimental edits
    • Push!
      • git checkout devel && git push
      • It failed?
      • git push --set-upstream origin devel
    • Creating new branches at remote
      • --set-upstream tells git to push and pull local devel branch to remote devel branch, and create one if necessary
      • Future pushes at this branch do not need --set-upstream
      • This push goes to your repo
    • Pull requests
      • Go to your fork of git-gud.git
      • Base fork: tsdmgz/git-gud base: master <- head fork: <username>/git-gud compare: devel
      • Create pull request

      • Write a title about your pull request
      • Explain why you want this PR merged
    • Social interactions
      • Pull requests is more of a social thing
      • GitHub provides a template on asking someone to include your changes and an easy way of integrating those changes
      • Possible to do outside of GitHub simply by asking someone to pull your changes and integrate it
      • Canonical repositories are "socially accepted" or simply because we say so and we accept it as is, or as business requirements dictate. Or because you're the maintaner of that project (nothing's stopping you from forking and making a new project out of it)
  • About commit messages
    • Commit messages
      • 50char or less summary of changes
      • Body for explaining what and why do the change, wrap to 72char
      • How is answered by git diff
      • https://chris.beams.io/posts/git-commit/
      • Why 50char subject? Mostly because GitHub
      • Vim tip: :set textwidth=72|set colorcolumn=+1
      • Emacs/Nano: ¯\(ツ)
    • Giving someone direct commit access to a repo
    • git branch -r
  • Scenarios
    • git commit --amend
    • Looking at previous commits
      • git log
    • What changed between commits
      • git diff commitA commitB
      • Can be tag, branch, even something from reflog
      • If it has a commit ID, it can be diffed
    • Syncing your fork with upstream
      • git remote add upstream <repo-url>
      • git pull upstream devel
      • git push origin devel
    • Partially staging files for commit
      • git add --patch
      • git add --interactive
    • Reverting a buggy commit
      • git revert
      • vs git reset --hard
    • Accidentally lost a commit
      • git reflog
      • git checkout <commitHash>
      • Garbage collection and unreachable commits
  • References

git-gud's People

Contributors

tsdmgz avatar

Watchers

 avatar  avatar

Forkers

ronaldjayrjover

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.