Code Monkey home page Code Monkey logo

git-kata's Introduction

Git Kata - Clean History

Git Logo

A clean Git history is beneficial to a project in many ways. Similar to how clean code documents the current state of the software, a well-tended Git log documents what changes happened and why. For example,

  • What are the design decision in a pull request?
  • What has happened since the last fetch?
  • Why did the implementation of a function change?
  • Was this a refactoring or a change in functionality?
  • When did the bug got introduced? (supported by git-bisect)

However, good commit messages are not enough for a clean Git history, and we need tend to and refactor our history before we "commit" to it; or in other words, rewrite the history. For all the questions above, we want to have coherent, small, and working commits. Further, a linear history helps to comprehend the sequence of changes more easily.

To visualize this, we want to go from this kind of Git log (here, only 3 developers worked in parallel) Git merge

to this kind of linear history (here, 5 developers worked in parallel) Git rebase

or even as linear as OneFlow. Git oneflow

Note: This kata assumes that you are already have basic Git knowledge, like how to stage files, commit changes, push to origin, fetch and pull from remote, branching, and work with the Git log.


Quick Start

  • Ensure the latest Git is installed and available in the shell
  • Navigate to the folder of an exercise; e.g., <kata-root>/101-local-amend-commit
  • Run the ./init.sh in that folder
    • On Windows, use Git BASH or other Bash emulators (e.g., cmder)
  • Navigate to the created/updated folder <kata-root>/exercise with your favorite Git client
  • Consult the README.md in that folder for the description and task

With IntelliJ (optional)

This is optional, if you want to have compiler support of IntelliJ and/or use its integrated Git client.

  • Open this Gradle project with IntelliJ
    • You can use the free Community Edition
    • On Windows, set Settings > Tools > Terminal > Shell path to "<system-path-to-git>\bin\bash.exe" --login -i (see Note)
  • In the project view, right-click the init.sh of an exercise and run it with Run 'init.sh'
  • Select the created/updated folder <kata-root>/exercise and open the Git tool window (ALT+9)
    • If you cloned this repository, in the Git Log window, chose the filter Paths: exercise
  • Consult the README.md in that folder for the description and task

Note

The init scripts for this kata are bash scripts, at the moment. Thus, you need a Bash to execute them. Fortunately for Windows, the Git Bash is a shell that can execute those scripts.


Links and Resources

The Git version control system

Katas inpired by

Naming conventions

Workflows

Merge & Rebase

Tutorials & Talks

Recommended Git Clients

Other Tools

git-kata's People

Contributors

andrej-dyck avatar

Watchers

James Cloos avatar

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.