{"id":13477163,"url":"https://github.com/initialcommit-com/git-sim","last_synced_at":"2025-05-12T15:28:13.830Z","repository":{"id":63378993,"uuid":"553679010","full_name":"initialcommit-com/git-sim","owner":"initialcommit-com","description":"Visually simulate Git operations in your own repos with a single terminal command.","archived":false,"fork":false,"pushed_at":"2025-04-06T17:01:56.000Z","size":7073,"stargazers_count":4483,"open_issues_count":5,"forks_count":114,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-04-23T17:16:54.319Z","etag":null,"topics":["git","gitpython","manim","opencv","python","python3","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/initialcommit-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","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,"zenodo":null},"funding":{"github":["initialcommit-com"]}},"created_at":"2022-10-18T15:36:17.000Z","updated_at":"2025-04-23T12:48:38.000Z","dependencies_parsed_at":"2023-12-13T06:23:38.670Z","dependency_job_id":"e60ae0ac-2ba1-45a2-a3a1-650f87b57fba","html_url":"https://github.com/initialcommit-com/git-sim","commit_stats":{"total_commits":233,"total_committers":7,"mean_commits":"33.285714285714285","dds":"0.24034334763948495","last_synced_commit":"fc7fb1203030cf0f1070a4ad1e84b2febcfdaa79"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/initialcommit-com%2Fgit-sim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/initialcommit-com%2Fgit-sim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/initialcommit-com%2Fgit-sim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/initialcommit-com%2Fgit-sim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/initialcommit-com","download_url":"https://codeload.github.com/initialcommit-com/git-sim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253765222,"owners_count":21960691,"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","gitpython","manim","opencv","python","python3","visualization"],"created_at":"2024-07-31T16:01:38.932Z","updated_at":"2025-05-12T15:28:13.806Z","avatar_url":"https://github.com/initialcommit-com.png","language":"Python","readme":"# git-sim\n![git-sim-logo-with-tagline-1440x376p45](https://user-images.githubusercontent.com/49353917/232990611-58d0693f-69c0-45c8-b51d-cd540793d18c.gif)\n\n[![GitHub license](https://img.shields.io/github/license/initialcommit-com/git-sim)](https://github.com/initialcommit-com/git-sim/blob/main/LICENSE)\n[![GitHub tag](https://img.shields.io/github/v/release/initialcommit-com/git-sim)](https://img.shields.io/github/v/release/initialcommit-com/git-sim)\n[![Downloads](https://static.pepy.tech/badge/git-sim)](https://pepy.tech/project/git-sim)\n[![Contributors](https://img.shields.io/github/contributors/initialcommit-com/git-sim)](https://github.com/initialcommit-com/git-sim/graphs/contributors)\n[![Share](https://img.shields.io/twitter/url?label=Share\u0026url=https%3A%2F%2Ftwitter.com%2Finitcommit)](https://twitter.com/intent/tweet?text=Check%20out%20%23gitsim%20%2D%20a%20tool%20to%20visualize%20%23Git%20operations%20in%20your%20local%20repos%20with%20a%20single%20terminal%20command,%20by%20%40initcommit!%20https%3A%2F%2Fgithub%2Ecom%2Finitialcommit%2Dcom%2Fgit%2Dsim)\n\n---\n🚨 New! [Check out Devlands](https://devlands.com): the next generation of git-sim and ***EVEN MORE visual way to learn and use Git***.\n\n🌱 [Devlands](https://devlands.com) transforms your Git repository into an immersive, visually enchanting world called a Devland, so you can literally walk through your codebase. This lets you explore your code from a visual perspective, to learn and use Git faster and more easily than ever before.\n\n🧠 If you like git-sim, you'll love this new hands-on approach to mastering Git commands and concepts!\n\n➡️ [Explore Devlands](https://devlands.com)\n\n---\n\nVisually simulate Git operations in your own repos with a single terminal command.\n\nThis generates an image (default) or video visualization depicting the Git command's behavior.\n\nCommand syntax is based directly on Git's command-line syntax, so using git-sim is as familiar as possible.\n\nExample: `$ git-sim merge \u003cbranch\u003e`\n\u003cbr/\u003e\u003cbr/\u003e\n![git-sim-merge_04-22-23_21-04-32_cropped](https://user-images.githubusercontent.com/49353917/233821875-a7bb640d-10be-4433-a8fb-bd25646eeff4.jpg)\n\nCheck out the [git-sim release blog post](https://initialcommit.com/blog/git-sim) for the full scoop!\n\n## Support git-sim\nGit-Sim is Free and Open-Source Software (FOSS). Your support will help me work on it (and other Git projects) full time!\n- [Sponsor Git-Sim on GitHub](https://github.com/sponsors/initialcommit-com)\n- [Support Git-Sim via Patreon](https://patreon.com/user?u=92322459)\n\n## Use cases\n- Visualize Git commands to understand their effects on your repo before actually running them\n- Prevent unexpected working directory and repository states by simulating before running\n- Share visualizations (jpg/png image or mp4/webm video) of your Git commands with your team, or the world\n- Save visualizations as a part of your team documentation to document workflow and prevent recurring issues\n- Create static Git diagrams (jpg/png) or dynamic animated videos (mp4/webm) to speed up content creation\n- Help visual learners understand how Git commands work\n- Combine with bundled command [git-dummy](https://github.com/initialcommit-com/git-dummy) to generate a dummy Git repo and then simulate operations on it\n\n## Features\n- Run a one-liner git-sim command in the terminal to generate a custom Git command visualization (.jpg) from your repo\n- Supported commands: `add`, `branch`, `checkout`, `cherry-pick`, `clean`, `clone`, `commit`, `config`, `fetch`, `init`, `log`, `merge`, `mv`, `pull`, `push`, `rebase`, `remote`, `reset`, `restore`, `revert`, `rm`, `stash`, `status`, `switch`, `tag`\n- Generate an animated video (.mp4) instead of a static image using the `--animate` flag (note: significant performance slowdown, it is recommended to use `--low-quality` to speed up testing and remove when ready to generate presentation-quality video)\n- Color commits by parameter, such as author with the `--color-by=author` option\n- Choose between dark mode (default) and light mode\n- Specify output formats of either jpg, png, mp4, or webm\n- Combine with bundled command [git-dummy](https://github.com/initialcommit-com/git-dummy) to generate a dummy Git repo and then simulate operations on it\n- Animation only: Add custom branded intro/outro sequences if desired\n- Animation only: Speed up or slow down animation speed as desired\n\n## Quickstart\nNote: If you prefer to install git-sim with Docker, skip steps (1) and (2) here and jump to the [Docker installation](#docker-installation) section below, then come back here to step (3).\n\n1) **Install Manim and its dependencies for your OS / environment:**\n    - [Install Manim on Windows](https://docs.manim.community/en/stable/installation/windows.html)\n    - [Install Manim on MacOS](https://docs.manim.community/en/stable/installation/macos.html)\n    - [Install Manim on Linux](https://docs.manim.community/en/stable/installation/linux.html)\n    - [Install Manim in Conda](https://docs.manim.community/en/stable/installation/conda.html)\n\n2) Install `git-sim`:\n\n```console\n$ pip3 install git-sim\n```\n\nNote: For MacOS, it is recommended to **NOT** use the system Python to install Git-Sim, and instead use [Homebrew](https://brew.sh) to install a version of Python to work with Git-Sim. Virtual environments should work too.\n\n3) Browse to the Git repository you want to simulate Git commands in:\n\n```console\n$ cd path/to/git/repo\n```\n\n4) Run the program:\n\n```console\n$ git-sim [global options] \u003csubcommand\u003e [subcommand options]\n```\n\nOptional: If you don't have an existing Git repo to simulate commands on, use the bundled [git-dummy](https://github.com/initialcommit-com/git-dummy) command to generate a dummy Git repo with the desired number of branches and commits to simulate operations on with git-sim:\n\n```console\n$ git-dummy --name=\"dummy-repo\" --branches=3 --commits=10\n$ cd dummy-repo\n$ git-sim [global options] \u003csubcommand\u003e [subcommand options]\n```\n\nOr if you want to do it all in a single command:\n\n```console\n$ git-dummy --no-subdir --branches=3 --commits=10 \u0026\u0026 git-sim [global options] \u003csubcommand\u003e [subcommand options]\n```\n\n5) Simulated output will be created as a `.jpg` file. Output files are named using the subcommand executed combined with a timestamp, and by default are stored in a subdirectory called `git-sim_media/`. The location of this subdirectory is customizable using the command line flag `--media-dir=path/to/output`. Note that when the `--animate` global flag is used, render times will be much longer and a `.mp4` video output file will be produced.\n\n6) For convenience, environment variables can be set for any global command-line option available in git-sim. All environment variables start with `git_sim_` followed by the name of the option.\n\nFor example, the `--media-dir` option can be set as an environment variable like:\n\n```console\n$ export git_sim_media_dir=~/Desktop\n```\n\nSimilarly, the `--speed` option can be set like:\n\n```console\n$ export git_sim_speed=2\n```\n\nBoolean flags can be set like:\n\n```console\n$ export git_sim_light_mode=true\n```\n\nIn general:\n\n```console\n$ export git_sim_option_name=option_value\n```\n\nExplicitly specifying options at the command-line takes precedence over the corresponding environment variable values.\n\n7) See global help for list of global options/flags and subcommands:\n\n```console\n$ git-sim -h\n```\n\n8) See subcommand help for list of options/flags for a specific subcommand:\n\n```console\n$ git-sim \u003csubcommand\u003e -h\n```\n\n## Requirements\n* Python 3.7 or greater\n* Pip (Package manager for Python)\n* [Manim (Community version)](https://www.manim.community/)\n\n## Commands\nBasic usage is similar to Git itself - `git-sim` takes a familiar set of subcommands including \"add\", \"branch\", \"checkout\", \"cherry-pick\", \"clean\", \"clone\", \"commit\", \"config\", \"fetch\", \"init\", \"log\", \"merge\", \"mv\", \"pull\", \"push\", \"rebase\", \"remote\", \"reset\", \"restore\", \"revert\", \"rm\", \"stash\", \"status\", \"switch\", \"tag\" along with corresponding options.\n\n\n```console\n$ git-sim [global options] \u003csubcommand\u003e [subcommand options]\n```\n\nThe `[global options]` apply to the overarching `git-sim` simulation itself, including:\n\n`-n \u003cnumber\u003e`: Number of commits to display from each branch head.  \n`--all`: Display all local branches in the log output.  \n`--animate`: Instead of outputting a static image, animate the Git command behavior in a .mp4 video.  \n`--color-by author`: Color commits by parameter, such as author.  \n`--invert-branches`: Invert positioning of branches by reversing order of multiple parents where applicable.  \n`--hide-merged-branches`: Hide commits from merged branches, i.e. only display mainline commits.  \n`--media-dir`: The path at which to store the simulated output media files.  \n`-d`: Disable the automatic opening of the image/video file after generation. Useful to avoid errors in console mode with no GUI.  \n`--light-mode`: Use a light mode color scheme instead of default dark mode.  \n`--reverse, -r`: Display commit history in the reverse direction.  \n`--img-format`: Output format for the image file, i.e. `jpg` or `png`. Default output format is `jpg`.  \n`--stdout`: Write raw image data to stdout while suppressing all other program output.  \n`--output-only-path`: Only output the path to the generated media file to stdout. Useful for other programs to ingest.  \n`--quiet, -q`: Suppress all output except errors.  \n`--highlight-commit-messages`: Make commit message text bigger and bold, and hide commit ids.  \n`--style`: Graphical style of the output image or animated video, i.e. `clean` (default) or `thick`.\n\nAnimation-only global options (to be used in conjunction with `--animate`):\n\n`--video-format`: Output format for the video file, i.e. `mp4` or `webm`. Default output format is `mp4`.  \n`--speed=n`: Set the multiple of animation speed of the output simulation, `n` can be an integer or float, default is 1.5.  \n`--low-quality`: Render the animation in low quality to speed up creation time, recommended for non-presentation use.  \n`--show-intro`: Add an intro sequence with custom logo and title.  \n`--show-outro`: Add an outro sequence with custom logo and text.  \n`--title=title`: Custom title to display at the beginning of the animation.  \n`--logo=logo.png`: The path to a custom logo to use in the animation intro/outro.  \n`--outro-top-text`: Custom text to display above the logo during the outro.  \n`--outro-bottom-text`: Custom text to display below the logo during the outro.  \n`--font`: Font family used to display rendered text.\n\nThe `[subcommand options]` are like regular Git options specific to the specified subcommand (see below for a full list).\n\nThe following is a list of Git commands that can be simulated and their corresponding options/flags.\n\n### git add\nUsage: `git-sim add \u003cfile 1\u003e \u003cfile 2\u003e ... \u003cfile n\u003e`\n\n- Specify one or more `\u003cfile\u003e` as a *modified* working directory file, or an untracked file\n- Simulated output will show files being moved to the staging area\n- Note that simulated output will also show the most recent 5 commits on the active branch\n\n![git-sim-add_01-05-23_22-07-40](https://user-images.githubusercontent.com/49353917/210940814-7e8dc318-6116-4e56-b415-bc547401a56a.jpg)\n\n### git branch\nUsage: `git-sim branch \u003cnew branch name\u003e`\n\n- Specify `\u003cnew branch name\u003e` as the name of the new branch to simulate creation of\n- Simulated output will show the newly create branch ref along with most recent 5 commits on the active branch\n\n![git-sim-branch_01-05-23_22-13-17](https://user-images.githubusercontent.com/49353917/210941509-2a42a7a4-2168-4f62-913f-3f6fe74a0684.jpg)\n\n### git checkout\nUsage: `git-sim checkout [-b] \u003cbranch\u003e`\n\n- Checks out `\u003cbranch\u003e` into the working directory, i.e. moves `HEAD` to the specified `\u003cbranch\u003e`\n- The `-b` flag creates a new branch with the specified name `\u003cbranch\u003e` and checks it out, assuming it doesn't already exist\n\n![git-sim-checkout_04-09-23_21-46-04](https://user-images.githubusercontent.com/49353917/230827836-e9f23a0e-2576-4716-b2fb-6327d3cf9b22.jpg)\n\n### git cherry-pick\nUsage: `git-sim cherry-pick \u003ccommit\u003e`\n\n- Specify `\u003ccommit\u003e` as a ref (branch name/tag) or commit ID to cherry-pick onto the active branch\n- Supports editing the cherry-picked commit message with: `$ git-sim cherry-pick \u003ccommit\u003e -e \"Edited commit message\"`\n\n![git-sim-cherry-pick_01-05-23_22-23-08](https://user-images.githubusercontent.com/49353917/210942811-fa5155b1-4c6f-4afc-bea2-d39b4cd594aa.jpg)\n\n### git clean\nUsage: `git-sim clean`\n\n- Simulated output will show untracked files being deleted\n- Since this is just a simulation, no need to specify `-i`, `-n`, `-f` as in regular Git\n- Note that simulated output will also show the most recent 5 commits on the active branch\n\n![git-sim-clean_04-09-23_22-05-54](https://user-images.githubusercontent.com/49353917/230830043-779e7230-f439-461a-a408-b19b263e86e4.jpg)\n\n### git clone\nUsage: `git-sim clone \u003curl\u003e`\n\n- Clone the remote repo from `\u003curl\u003e` (web URL or filesystem path) to a new folder in the current directory\n- Output will report if clone operation is successful and show log of local clone\n\n![git-sim-clone_04-09-23_21-51-53](https://user-images.githubusercontent.com/49353917/230828521-80c8d2d1-2a31-46bb-aeed-746f0441c86e.jpg)\n\n### git commit\nUsage: `git-sim commit -m \"Commit message\"`\n\n- Simulated output will show the new commit added to the tip of the active branch\n- Specify a commit message with the `-m` option\n- HEAD and the active branch will be moved to the new commit\n- Simulated output will show files in the staging area being included in the new commit\n- Supports amending the last commit with: `$ git-sim commit --amend -m \"Amended commit message\"`\n\n![git-sim-commit_01-05-23_22-10-21](https://user-images.githubusercontent.com/49353917/210941149-d83677a1-3ab7-4880-bc0f-871b1f150087.jpg)\n\n### git config\nUsage: `git-sim config [--list] \u003csection.option\u003e \u003cvalue\u003e`\n\n- Simulated output describes the specified configuration change\n- Use `--list` or `-l` to display all configuration\n\n![git-sim-config_04-16-24_08-34-34](https://github.com/initialcommit-com/git-sim/assets/49353917/c123e7a7-1fff-4f5c-b4a2-1e34ea2a4d80)\n\n### git fetch\nUsage: `git-sim fetch \u003cremote\u003e \u003cbranch\u003e`\n\n- Fetches the specified `\u003cbranch\u003e` from the specified `\u003cremote\u003e` to the local repo\n\n![git-sim-fetch_04-09-23_21-47-59](https://user-images.githubusercontent.com/49353917/230828090-acae8979-4097-43a8-96ea-525890e0e0a8.jpg)\n\n### git init\nUsage: `git-sim init`\n\n- Simulated output describes the initialized `.git/` directory and it's contents\n\n![git-sim-init_04-16-24_08-34-47](https://github.com/initialcommit-com/git-sim/assets/49353917/2abb1a4a-3022-4353-a828-2d337baa8383)\n\n### git log\nUsage: `git-sim log [-n \u003cnumber\u003e] [--all]`\n\n- Simulated output will show the most recent 5 commits on the active branch by default\n- Use `-n \u003cnumber\u003e` to set number of commits to display from each branch head\n- Set `--all` to display all local branches in the log output\n\n![git-sim-log_01-05-23_22-02-39](https://user-images.githubusercontent.com/49353917/210940300-aadd14c6-72ab-4529-a1be-b494ed5dd4c9.jpg)\n\n### git merge\nUsage: `git-sim merge \u003cbranch\u003e [-m \"Commit message\"] [--no-ff]`\n\n- Specify `\u003cbranch\u003e` as the branch name to merge into the active branch\n- If desired, specify a commit message with the `-m` option\n- Simulated output will depict a fast-forward merge if possible\n- Otherwise, a three-way merge will be depicted\n- To force a merge commit when a fast-forward is possible, use `--no-ff`\n- If merge fails due to merge conflicts, the conflicting files are displayed\n\n![git-sim-merge_01-05-23_09-44-46](https://user-images.githubusercontent.com/49353917/210942030-c7229488-571a-4943-a1f4-c6e4a0c8ccf3.jpg)\n\n### git mv\nUsage: `git-sim mv \u003cfile\u003e \u003cnew file\u003e`\n\n- Specify `\u003cfile\u003e` as file to update name/path\n- Specify `\u003cnew file\u003e` as new name/path of file \n- Simulated output will show the name/path of the file being updated \n- Note that simulated output will also show the most recent 5 commits on the active branch\n\n![git-sim-mv_04-09-23_22-05-13](https://user-images.githubusercontent.com/49353917/230829978-0a64dbe2-d974-4cef-9c6e-ed26e987342f.jpg)\n\n### git pull\nUsage: `git-sim pull [\u003cremote\u003e \u003cbranch\u003e]`\n\n- Pulls the specified `\u003cbranch\u003e` from the specified `\u003cremote\u003e` to the local repo\n- If `\u003cremote\u003e` and `\u003cbranch\u003e` are not specified, the active branch is pulled from the default remote\n- If merge conflicts occur, they are displayed in a table\n\n![git-sim-pull_04-09-23_21-50-15](https://user-images.githubusercontent.com/49353917/230828298-455c0a9d-cf94-499e-9e35-623e7b218772.jpg)\n\n### git push\nUsage: `git-sim push [\u003cremote\u003e \u003cbranch\u003e]`\n\n- Pushes the specified `\u003cbranch\u003e` to the specified `\u003cremote\u003e` and displays the local result\n- If `\u003cremote\u003e` and `\u003cbranch\u003e` are not specified, the active branch is pushed to the default remote\n- If the push fails due to remote changes that don't exist in the local repo, a message is included telling the user to pull first, along with color coding which commits need to be pulled\n\n![git-sim-push_04-21-23_13-41-57](https://user-images.githubusercontent.com/49353917/233731005-51fd7887-ae14-4ceb-a5d5-e5aed79e9fd8.jpg)\n\n### git rebase\nUsage: `git-sim rebase \u003cnew-base\u003e`\n\n- Specify `\u003cnew-base\u003e` as the branch name to rebase the active branch onto\n\n![git-sim-rebase_01-05-23_09-53-34](https://user-images.githubusercontent.com/49353917/210942598-4ff8d1e6-464d-48f3-afb9-f46f7ec4828c.jpg)\n\n### git remote\nUsage: `git-sim remote [add|rename|remove|get-url|set-url] [\u003cremote\u003e] [\u003curl\u003e]`\n\n- Simulated output will show remotes being added, renamed, removed, modified as indicated\n- Running `git-sim remote` with no options will list all existing remotes and their details  \n\n![git-sim-remote_04-16-24_08-40-37](https://github.com/initialcommit-com/git-sim/assets/49353917/ebaff04c-d5b6-4691-97b3-60bb502ba444)\n\n### git reset\nUsage: `git-sim reset \u003creset-to\u003e [--mixed|--soft|--hard]`\n\n- Specify `\u003creset-to\u003e` as any commit id, branch name, tag, or other ref to simulate reset to from the current HEAD (default: `HEAD`)\n- As with a normal git reset command, default reset mode is `--mixed`, but can be specified using `--soft`, `--hard`, or `--mixed`\n- Simulated output will show branch/HEAD resets and resulting state of the working directory, staging area, and whether any file changes would be deleted by running the actual command\n\n![git-sim-reset_01-05-23_22-15-49](https://user-images.githubusercontent.com/49353917/210941835-80f032d2-4f06-4032-8dd0-98c8a2569049.jpg)\n\n### git restore\nUsage: `git-sim restore \u003cfile 1\u003e \u003cfile 2\u003e ... \u003cfile n\u003e`\n\n- Specify one or more `\u003cfile\u003e` as a *modified* working directory file, or staged file\n- Simulated output will show files being moved back to the working directory or discarded changes\n- Note that simulated output will also show the most recent 5 commits on the active branch\n\n![git-sim-restore_01-05-23_22-09-14](https://user-images.githubusercontent.com/49353917/210941009-e6bf7271-ce9b-4e41-9a0b-24cc4b8d3b15.jpg)\n\n### git revert\nUsage: `git-sim revert \u003cto-revert\u003e`\n\n- Specify `\u003cto-revert\u003e` as any commit id, branch name, tag, or other ref to simulate revert for\n- Simulated output will show the new commit which reverts the changes from `\u003cto-revert\u003e`\n- Simulated output will include the next 4 most recent commits on the active branch\n\n![git-sim-revert_01-05-23_22-16-59](https://user-images.githubusercontent.com/49353917/210941979-6db8b55c-2881-41d8-9e2e-6263b1dece13.jpg)\n\n### git rm\nUsage: `git-sim rm \u003cfile 1\u003e \u003cfile 2\u003e ... \u003cfile n\u003e`\n\n- Specify one or more `\u003cfile\u003e` as a *tracked* file\n- Simulated output will show files being removed from Git tracking\n- Note that simulated output will also show the most recent 5 commits on the active branch\n\n![git-sim-rm_04-09-23_22-01-29](https://user-images.githubusercontent.com/49353917/230829899-f5d688ea-bc8e-46f9-a54a-55d251c8915d.jpg)\n\n### git stash\nUsage: `git-sim stash [push|pop|apply] \u003cfile\u003e`\n\n- Specify one or more `\u003cfile\u003e` as a *modified* working directory file, or staged file\n- If no `\u003cfile\u003e` is specified, all available files will be included\n- Simulated output will show files being moved in/out of the Git stash\n- Note that simulated output will also show the most recent 5 commits on the active branch\n\n![git-sim-stash_01-05-23_22-11-18](https://user-images.githubusercontent.com/49353917/210941254-69c80b63-5c06-411a-a36a-1454b2906ee8.jpg)\n\n### git status\nUsage: `git-sim status`\n\n- Simulated output will show the state of the working directory, staging area, and untracked files\n- Note that simulated output will also show the most recent 5 commits on the active branch\n\n![git-sim-status_01-05-23_22-06-28](https://user-images.githubusercontent.com/49353917/210940685-735665e2-fa12-4043-979c-54c295b13800.jpg)\n\n### git switch\nUsage: `git-sim switch [-c] \u003cbranch\u003e`\n\n- Switches the checked-out branch to `\u003cbranch\u003e`, i.e. moves `HEAD` to the specified `\u003cbranch\u003e`\n- The `-c` flag creates a new branch with the specified name `\u003cbranch\u003e` and switches to it, assuming it doesn't already exist\n\n![git-sim-switch_04-09-23_21-42-43](https://user-images.githubusercontent.com/49353917/230827783-a8740ace-b66f-4cac-b94e-5d101d27e0b5.jpg)\n\n### git tag\nUsage: `git-sim tag \u003cnew tag name\u003e`\n\n- Specify `\u003cnew tag name\u003e` as the name of the new tag to simulate creation of\n- Simulated output will show the newly create tag ref along with most recent 5 commits on the active branch\n\n![git-sim-tag_01-05-23_22-14-18](https://user-images.githubusercontent.com/49353917/210941647-79376ff7-2941-42b3-964a-b1d3a404a4fe.jpg)\n\n## Video animation examples\n```console\n$ git-sim --animate reset HEAD^\n```\n\nhttps://user-images.githubusercontent.com/49353917/210943230-f38d879b-bb0d-4d42-a196-f24efb9e351a.mp4\n\n```console\n$ git checkout main\n$ git-sim --animate merge dev\n```\n\nhttps://user-images.githubusercontent.com/49353917/210943418-22c2cd11-be96-41bc-b621-7018eebc6bc0.mp4\n\n```console\n$ git checkout dev\n$ git-sim --animate rebase main\n```\n\nhttps://user-images.githubusercontent.com/49353917/210943815-4b8be2da-18da-4c42-927a-61cf9a22834e.mp4\n\n```console\n$ git checkout main\n$ git-sim --animate cherry-pick dev\n```\n\nhttps://user-images.githubusercontent.com/49353917/210944001-77bd0130-306b-40a8-ba0b-22e50172802b.mp4\n\n## Basic command examples\nSimulate the output of the git log command:\n\n```console\n$ cd path/to/git/repo\n$ git-sim log\n```\n\nSimulate the output of the git status command:\n\n```console\n$ git-sim status\n```\n\nSimulate adding a file to the Git staging area:\n\n```console\n$ git-sim add filename.ext\n```\n\nSimulate restoring a file from the Git staging area:\n\n```console\n$ git-sim restore filename.ext\n```\n\nSimulate creating a new commit based on currently staged changes:\n\n```console\n$ git-sim commit -m \"Commit message\"\n```\n\nSimulate stashing all working directory and staged changes:\n\n```console\n$ git-sim stash\n```\n\nSimulate creating a new Git branch:\n\n```console\n$ git-sim branch new-branch-name\n```\n\nSimulate creating a new Git tag:\n\n```console\n$ git-sim tag new-tag-name\n```\n\nSimulate a hard reset of the current branch HEAD to the previous commit:\n\n```console\n$ git-sim reset HEAD^ --hard\n```\n\nSimulate reverting the changes in an older commit:\n\n```console\n$ git-sim revert HEAD~7\n```\n\nSimulate merging a branch into the active branch:\n\n```console\n$ git-sim merge feature1\n```\n\nSimulate rebasing the active branch onto a new base:\n\n```console\n$ git-sim rebase main\n```\n\nSimulate cherry-picking a commit from another branch onto the active branch:\n\n```console\n$ git-sim cherry-pick 0ae641\n```\n\n## Command examples with extra options/flags\nUse light mode for white background and black text, instead of the default black background with white text:\n\n```console\n$ git-sim --light-mode status\n```\n\nAnimate the simulated output as a .mp4 video file:\n\n```console\n$ git-sim --animate add filename.ext\n```\n\nAdd an intro and outro with custom text and logo (must include `--animate`):\n\n```console\n$ git-sim --animate --show-intro --show-outro --outro-top-text=\"My Git Repo\" --outro-bottom-text=\"Thanks for watching!\" --logo=path/to/logo.png status\n```\n\nCustomize the output image/video directory location:\n\n```console\n$ git-sim --media-dir=path/to/output status\n```\n\nOptionally, set the environment variable `git_sim_media_dir` to set a global default media directory, to be used if no `--media-dir` is provided. Simulated output images/videos will be placed in this location, in subfolders named with the corresponding repo's name.\n\n```console\n$ export git_sim_media_dir=path/to/media/directory\n$ git-sim status\n```\nNote: `--media-dir` takes precedence over the environment variable. If you set the environment variable and still provide the argument, you'll find the media in the path provided by `--media-dir`.\n\nGenerate output video in low quality to speed up rendering time (useful for repeated testing, must include `--animate`):\n\n```console\n$ git-sim --animate --low-quality status\n```\n\n## Installation\nSee **Quickstart** section for details on installing manim and other dependencies. Then run:\n\n```console\n$ pip3 install git-sim\n```\n\n## Docker installation\n\n1) Clone down the git-sim repository:\n\n```console\n$ git clone https://github.com/initialcommit-com/git-sim.git\n```\n\n2) Browse into the `git-sim` folder and build the Docker image:\n\n```console\n$ docker build -t git-sim .\n```\n\n3) Run git-sim commands as follows:\n    - Windows: `docker run --rm -v %cd%:/usr/src/git-sim git-sim [global options] \u003csubcommand\u003e [subcommand options]`\n    - MacOS / Linux: `docker run --rm -v $(pwd):/usr/src/git-sim git-sim [global options] \u003csubcommand\u003e [subcommand options]`\n    \nOptional: On MacOS / Linux / or GitBash in Windows, create an alias for the long docker command so your can run it as a normal `git-sim` command. To do so add the following line to your `.bashrc` or equivalent, then restart your terminal:\n\n```bash\ngit-sim() { docker run --rm -v $(pwd):/usr/src/git-sim git-sim \"$@\"; }\n```\n\nThis will enable you to run git-sim subcommands as [described above](#commands).\n\n## Learn More\nLearn more about this tool on the [git-sim project page](https://initialcommit.com/tools/git-sim).\n\n## Authors\n**Jacob Stopak** - on behalf of [Initial Commit](https://initialcommit.com)\n","funding_links":["https://github.com/sponsors/initialcommit-com","https://patreon.com/user?u=92322459"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finitialcommit-com%2Fgit-sim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finitialcommit-com%2Fgit-sim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finitialcommit-com%2Fgit-sim/lists"}