{"id":15029533,"url":"https://github.com/eficode-academy/git-katas","last_synced_at":"2025-04-11T09:36:50.202Z","repository":{"id":38830838,"uuid":"67723575","full_name":"eficode-academy/git-katas","owner":"eficode-academy","description":"A set of exercises for deliberate Git Practice","archived":false,"fork":false,"pushed_at":"2024-09-06T10:44:59.000Z","size":2819,"stargazers_count":1326,"open_issues_count":61,"forks_count":895,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-10-29T17:54:43.040Z","etag":null,"topics":["git","git-exercises","git-katas","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eficode-academy.png","metadata":{"files":{"readme":"README.md","changelog":"change-author/README.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-08T17:06:03.000Z","updated_at":"2024-10-28T21:38:08.000Z","dependencies_parsed_at":"2024-11-20T22:17:00.250Z","dependency_job_id":null,"html_url":"https://github.com/eficode-academy/git-katas","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eficode-academy%2Fgit-katas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eficode-academy%2Fgit-katas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eficode-academy%2Fgit-katas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eficode-academy%2Fgit-katas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eficode-academy","download_url":"https://codeload.github.com/eficode-academy/git-katas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248368648,"owners_count":21092418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","git-exercises","git-katas","hacktoberfest"],"created_at":"2024-09-24T20:10:56.231Z","updated_at":"2025-04-11T09:36:50.165Z","avatar_url":"https://github.com/eficode-academy.png","language":"Shell","readme":"---\nmaintainer: JKrag\n---\n# Git Katas\n\n## Quick Start\n\n### In the Cloud\n\n[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/praqma-training/git-katas.git)\n\n### On Your Local Machine\n\n![Quick Start](/images/quickstart.gif)\n\n- Clone this repository\n- Go into the folder you want to solve an exercise in\n- Run the `setup.sh` script\n- Consult the README.md in that folder to get a description of the exercise\n\n## Purpose of Git Katas\n\nThis repository is a collection of Git exercises.\nThe concept is stolen without shame from [Schauderhaft.de](http://blog.schauderhaft.de/gitkata/).\nUnfortunately, they have not maintained the system - and we need more good Git exercises.\n\nThe exercises are designed for use when we are teaching Git courses. You should be able to use them as self-contained exercises that will allow you to keep your Git skills sharp.\n\nExercises starting with _basic_ are entry-level - other exercises vary greatly in difficulty.\n\nTo get an overview of the exercises in here look in [Overview.md](Overview.md).\n\nFeel free to use these exercises, that's why they're public!\n\n## Suggested Learning Path\n\nIf you are coming to this repository for some basic Git knowledge, we recommend going through the exercises in the following order.\nThis is the order that Jan Krag at Praqma teaches Git and might change over time. There are more exercises than this, but these should take you through\neverything you need to be able to use Git effectively in your day to day life.\n\n- [Basic Commits](./basic-commits/README.md)\n- [Basic Staging](./basic-staging/README.md)\n- [Investigation](./investigation/README.md)\n- [Basic Branching](./basic-branching/README.md)\n- [Fast Forward Merge](./ff-merge/README.md)\n- [3 way Merge](./3-way-merge/README.md)\n- [Merge Mergesort](./merge-mergesort/README.md)\n- [Rebase Branch](./rebase-branch/README.md)\n- [Basic Revert](./basic-revert/README.md)\n- [Reset](./reset/README.md)\n- [Basic Cleaning](./basic-cleaning/README.md)\n- [Amend](./amend/README.md)\n- [Reorder the History](./reorder-the-history/README.md)\n- [Advanced Rebase Interactive](./advanced-rebase-interactive/README.md)\n- [Rebase using autosquash](./rebase-interactive-autosquash/README.md)\n- [Basic Stashing](./basic-stashing/README.md)\n\nSee [Overview.md](Overview.md) for a more complete list and suggested order.\n\n## Contributing\n\nIf you miss exercises or find errors in any of them, feel free to improve them and make a pull request.\n\nYou can also make an issue so we notice an opportunity to improve!\n\nThank you!\n\n### Celebrating success\n\nOn September 6th, 2023, we reached the milestone of having 1000 stars on GitHub. Thank you all for your support! This repository would not be where it is without the valuable contributions from the community.\n\n![1000 stars](/docs/1000stars-git-katas.png)\n\n## Cheatsheet\n\nA collection of useful commands to use throughout the exercises:\n\n```shell\n# Initializing an empty git repository.\ngit init            # Initialize an empty git repository under current directory.\n\n# Cloning a repository\ngit clone https://github.com/praqma-training/git-katas.git      # Clone this repository to your current working directory\n\n# Git (user and repo level) configurations\ngit config --local user.name \"Repo-level Username\"          # For setting a local git repo level user name.\ngit config --local user.email \"Repo-level.Email@Example.com\" # For setting a local git repo level user email.\n                                                            # --global -\u003e User level git config stored in \u003cuser-home\u003e/.gitconfig for e.g. ~/.gitconfig\n                                                            # --local -\u003e repo level config stored in repo's main dir under .git/config\n\n\n# See local changes\ngit status                  # Show the working tree status\ngit diff                    # Show changes current working directory (not yet staged)\ngit diff --cached           # Show changes currently staged for commit\n\n# Add files to staging (before a commit)\ngit add myfile.txt          # Add myfile.txt to stage\ngit add .                   # Add entire working directory to stage\n\n# Make a commit\ngit commit                              # Make a new commit with the changes in your staging area. This will open an editor for a commit message.\ngit commit -m \"I love documentation\"    # Make a new commit with a commit message from the command line\ngit commit -a                           # Make a new commit and automatically \"add\" changes from all known files\ngit commit -am \"I still do!\"            # A combination of the above\ngit commit --amend                      # Re-do the commit message of the previous commit (don't do this after pushing!)\n                                        #   We _never_ change \"public history\"\ngit reset \u003cfile\u003e                        # Unstage a staged file leaving in working directory without losing any changes.\ngit reset --soft [commit_hash]          # resets the current branch to \u003ccommit\u003e. Does not touch the staging area or the working tree at all.\n                                        # --hard mode would discard all changes.\n\n# Configuring a different editor\n## Avoid Vim but stay in terminal:\n- `git config --global core.editor nano`\n\n## For Windows:\n- Use Notepad:\n`git config --global core.editor notepad`\n\n- or for instance Notepad++:\n`git config --global core.editor \"'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin\"`\n\n\n# See history\ngit log             # Show commit logs\ngit log --oneline   # Formats commits to a single line (shorthand for --pretty=oneline  --abbrev-commit )\ngit log --graph     # Show a graph commits and branches\ngit log --pretty=fuller     # To see commit log details with author and committer details, if any different.\ngit log --follow \u003cfile\u003e     # List the history of a file beyond renames\ngit log branch2..branch1    # Show commits reachable from branch1 but not from branch2\n\n# Deferring\ngit stash                               # Stash (store temporarily) changes in working branch and enable checkingout a new branch\ngit stash list                          # List stored stashes.\ngit stash apply \u003cstash\u003e                 # Apply given \u003cstash\u003e, or if none given the latest from stash list.\n\n\n# Working with Branches\ngit branch my-branch       # Create a new branch called my-branch\ngit switch my-branch     # Switch to a different branch to work on it\ngit switch -c my-branch  # Create a new branch called my-branch AND switch to it\ngit branch -d my-branch    # Delete branch my-branch that has been merged with master\ngit branch -D my-branch    # Forcefully delete a branch my-branch that hasn't been merged to master\n\n# Merging\ngit merge master         # Merge the master branch into your currently checked out branch.\ngit rebase master        # Rebase current branch on top of master branch\n\n# Working with Remotes\ngit remote              # Show your current remotes\ngit remote -v           # Show your current remotes and their URLs\ngit push                # Publish your commits to the upstream master of your currently checked out branch\ngit push -u origin my-branch  # Push newly created branch to remote repo setting up to track remote branch from origin.\n                              # No need to specify remote branch name, for e.g., when doing a 'git pull' on that branch.\ngit pull                # Pull changes from the remote to your currently checked out branch\n\n# Re/moving files under version control\ngit rm \u003cpath/to/the/file\u003e                 # remove file and stage the change to be committed.\ngit mv \u003csource/file\u003e \u003cdestination/file\u003e   # move/rename file and stage the change to be committed.\n\n# Aliases - it's possible to make aliases of frequently used commands\n#   This is often done to make a command shorter, or to add default flags\n\n# Adding a shorthand \"sw\" for \"switch\"\ngit config --global alias.sw \"switch\"\n# Usage:\ngit sw master     # Does a \"git switch master\"\n\n## Logging\ngit log --graph --oneline --all # Show a nice graph of the previous commits\n## Adding an alias called \"lol\" (log oneline..) that shows the above\ngit config --global alias.lol \"log --graph --oneline --all\"\n## Using the alias\ngit lol     # Does a \"git log --graph --oneline --all\"\n```\n\n## Testing\n\nThere is a very small test that you can run in powershell or bash.\nIt is contained in the scripts `test.sh` and `test.ps1`.\n\n### Cleanup\n\nYou can remove testing artifacts, `exercise` directories, with the git clean command:\n\n```sh\ngit clean -ffdX\n```\n","funding_links":[],"categories":["Foundations"],"sub_categories":["Git"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feficode-academy%2Fgit-katas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feficode-academy%2Fgit-katas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feficode-academy%2Fgit-katas/lists"}