git is hard but time travel in git is easy. PRESENTATION BY MONICA POWELL @waterproofheart πŸ”— www.aboutmonica.com/

Hi, I’m Monica Powell! I’m a Full Stack Engineer at Meetup and organizer of the React Ladies Meetup group. I’ve written about git and other tech adventures in publications such as FreeCodeCamp, Hacker Noon and Code Like A Girl. @waterproofheart πŸ”— www.aboutmonica.com/

Talk Outline 1. Introduction 2. How to write git commits dated in the future 3. Changing the languages that GitHub auto-detects in a repository 4. Automating git workflow 5. Resources @waterproofheart πŸ”— www.aboutmonica.com/

What is git? A distributed version-control system for tracking changes in source code during software development. @waterproofheart πŸ”— www.aboutmonica.com/

What is the relationship between GitHub/BitBucket/GitLab and git?? @waterproofheart πŸ”— www.aboutmonica.com/

TIME TRAVEL IN GIT It’s not a bug! It’s a feature. @waterproofheart πŸ”— www.aboutmonica.com/

DEBUGGING The marketing mix is a business tool used in marketing and by marketers, originally can be used @waterproofheart πŸ”— www.aboutmonica.com/

CREATE FUTURE COMMIT Checkout new branch Change computer time & replicate issue locally Squash bug and fix issue Commit and push fix Oops! @waterproofheart πŸ”— www.aboutmonica.com/

Is that the only way to commit in the future? @waterproofheart πŸ”— www.aboutmonica.com/

OTHER WAYS TO MODIFY COMMIT DATES

  • The Date format must follow the Git standard RFC 2822 or ISO 8601. - Can rebase and apply changes commits to the past as well. @waterproofheart πŸ”— www.aboutmonica.com/

What does this look like on GitHub? Write here a list of features, textboxes easy to edit Here you can write more More about your project. Statistics, analysis and content export GIT_AUTHOR_DATE=”Wed Mar 20 15:12:30 2019 -0700” export GIT_COMMITTER_DATE=”Wed Mar 20 15:12:30 2019 -0700” git commit -m β€œfuture commit” @waterproofheart πŸ”— www.aboutmonica.com/

@waterproofheart πŸ”— www.aboutmonica.com/

Reclassify Language With One Line of Code @waterproofheart πŸ”— www.aboutmonica.com/

Linguist library Python Application + CSS = 98.9% CSS and 1.1% Other??? @waterproofheart πŸ”— www.aboutmonica.com/

Linguist library β€œThis library is used on GitHub.com to detect blob languages, ignore binary or vendored files, suppress generated files in diffs, and generate language breakdown graphs.” https://github.com/github/linguist#my-repository-isnt-showing-my-la nguage @waterproofheart πŸ”— www.aboutmonica.com/

Linguist library 1 2 3 @waterproofheart πŸ”— www.aboutmonica.com/

GIT HOOKS Automate your git workflow @waterproofheart πŸ”— www.aboutmonica.com/

1 TIME TRAVEL IN GIT Build better presentations in less time @waterproofheart πŸ”— www.aboutmonica.com/

1 TIME TRAVEL IN GIT Build better presentations in less time @waterproofheart πŸ”— www.aboutmonica.com/

What is a git hook? Bash scripts that are executed at specific points within the git workflow. precommit, postcommit, prepush, postpush, etc…. Git Hooks Documentation: https://git-scm.com/docs/githooks @waterproofheart πŸ”— www.aboutmonica.com/

Where do they live? Every Git repository has a hidden .git/hooks directory with a script for each hook you can bind to. These can be modified. @waterproofheart πŸ”— www.aboutmonica.com/

How can git hooks be used? ● Warn when committing to master ● Run linting and tests before committing ● Warn or abort when committing code with: console.logs(), sensitive credentials, merge conflict strings or large files. ● Send notifications after a commit is pushed ● Sending intl objects to be translated ● And 1270824+ other ways. @waterproofheart πŸ”— www.aboutmonica.com/

Git Hook Package.json Example @waterproofheart πŸ”— www.aboutmonica.com/

Git Hooks Bash Script Example Warn when committing to master Run linting and tests before committing Warn or abort when committing code with: console.logs(), sensitive credentials, merge conflict strings or large file Send notifications after a commit is pushed Sending intl objects to be translated And 1270824+ other ways. @waterproofheart πŸ”— www.aboutmonica.com/

How can git hooks be used? @waterproofheart πŸ”— www.aboutmonica.com/

Limitations of Git Hooks ● Limited enforcement - can easily be overridden β€”no-verify or forced pushes ● Local hooks != shared hooks as .git/hooks not in version control ● Doesn’t replace CI, server-side branch protection or code reviews @waterproofheart πŸ”— www.aboutmonica.com/

Helpful Git Resources β€’ Git Lens Plugin https://gitlens.amod.io/ β€’ Git Books https://git-scm.com/book/en/v2 β€’ git-together β€” better attribution https://github.com/kejadlen/git-together β€’ Husky https://github.com/typicode/husky β€’ Git Attributes templates https://github.com/alexkaratarakis/gitatt ributes β€’ Git Hook Templates https://github.com/pre-commit/pre-commit -hooks Git Hooks 101 Website https://githooks.com/ @waterproofheart πŸ”— www.aboutmonica.com/

Thanks! Any questions? Feel free to reach out: monica@aboutmonica.com https://www.meetup.com/React-Ladies @waterproofheart πŸ”— www.aboutmonica.com/