| None | IE=edge |
| theme-color | #ffffff |
| ic-lesson-total | 16 |
| ic-lesson-paths | /learn/git/levels/git-overview,/learn/git/levels/init-and-config,/learn/git/levels/add-and-commit,/learn/git/levels/log-and-status,/learn/git/levels/clone-and-remote,/learn/git/levels/push-and-pull,/learn/git/levels/branch-and-switch,/learn/git/levels/merge,/learn/git/levels/tag,/learn/git/levels/stash,/learn/git/levels/restore,/learn/git/levels/revert,/learn/git/levels/reset,/learn/git/levels/rebase,/learn/git/levels/detached-head,/learn/git/levels/remove-and-rename |
| ic-lesson | /learn/git/levels/remove-and-rename|Level 16: Remove & rename |
| og:type | website |
| og:site_name | git-sim, by Initial Commit |
| og:image | https://initialcommit.com/images/share/share-viewer-bf187d2f.png |
| og:image:secure_url | https://initialcommit.com/images/share/share-viewer-bf187d2f.png |
| og:image:width | 1200 |
| og:image:height | 630 |
| twitter:card | summary_large_image |
| twitter:url | https://initialcommit.com/tools/git-sim/viewer |
| twitter:image | https://initialcommit.com/images/share/share-viewer-bf187d2f.png |
|
Initial Commit
| https://initialcommit.com/ |
| HOME | https://initialcommit.com/ |
| EXPLORE | https://initialcommit.com/learn/git/animated-cheat-sheet |
| Animated Git Cheat Sheet | https://initialcommit.com/learn/git/animated-cheat-sheet |
| Visual Git command reference | https://initialcommit.com/learn/git/visual-command-reference |
| Git command demos | https://initialcommit.com/tools/git-sim/viewer#commands |
| LEARN | https://initialcommit.com/learn/git |
| Git lessons | https://initialcommit.com/learn/git |
| Git workflow demos | https://initialcommit.com/tools/git-sim/viewer#workflows |
| Git commands | https://initialcommit.com/learn/git/commands |
| Git articles | https://initialcommit.com/learn/git/articles |
| Git basics | https://initialcommit.com/learn/git/basics |
| Working with a team | https://initialcommit.com/learn/git/team |
| Getting unstuck | https://initialcommit.com/learn/git/rescue |
| All Git topics | https://initialcommit.com/learn/git/topics |
| Python | https://initialcommit.com/cluster/python |
| Java | https://initialcommit.com/cluster/java |
| Amazon Web Services (AWS) | https://initialcommit.com/cluster/amazon-web-services-aws |
| Spring Boot | https://initialcommit.com/cluster/spring-boot |
| General Programming | https://initialcommit.com/cluster/general-programming |
| History of Programming | https://initialcommit.com/cluster/history-of-programming |
| JavaScript & Node.js | https://initialcommit.com/cluster/javascript |
| Vim | https://initialcommit.com/cluster/vim |
| DEVELOP | https://initialcommit.com/tools |
| git-sim | https://initialcommit.com/tools/git-sim |
| git-sim viewer | https://initialcommit.com/tools/git-sim/viewer |
| git-sim live | https://initialcommit.com/tools/git-sim#live |
| git-sim agentic | https://initialcommit.com/tools/git-sim#agents |
| git-sim → VS Code | https://initialcommit.com/tools/git-sim#vscode |
| git-dummy | https://initialcommit.com/tools/git-dummy |
| Devlands | https://devlands.com |
| All tools | https://initialcommit.com/tools |
| BOOKS | https://initialcommit.com/store?type=book |
| BLOG | https://initialcommit.com/blog |
| ABOUT | https://initialcommit.com/about |
| CONTACT | https://initialcommit.com/contact |
| Blog RSS | https://initialcommit.com/blog/rss.xml |
|
A feature branch, start to finish7 steps
Branch off main and commit on the branch while main moves on too, then merge the branch back and delete it.
git switch -c feature/searchgit commit -m "Add search box"git commit -m "Add search tests"git switch maingit commit -am "Update README"git merge feature/searchgit branch -d feature/search
Play the workflow →
| https://initialcommit.com/tools/git-sim/viewer?seq=feature-branch |
|
Rebase a branch, then fast-forward3 steps
Replay a feature branch on top of main, so merging it is a fast-forward.
git rebase maingit switch maingit merge feature/pagination
Play the workflow →
| https://initialcommit.com/tools/git-sim/viewer?seq=rebase-then-merge |
|
From an edit to a commit5 steps
A new file and an edit move from the working directory to the staging area and into a commit.
new file search.htmledit app.pygit add search.htmlgit add app.pygit commit -m "Add search box"
Play the workflow →
| https://initialcommit.com/tools/git-sim/viewer?seq=edit-stage-commit |
|
Stash, fix something else, come back6 steps
Put unfinished work aside, fix a bug on its own branch, merge it, and pick the work back up.
git stashgit switch -c hotfix/logingit commit -am "Fix login form"git switch maingit merge hotfix/logingit stash pop
Play the workflow →
| https://initialcommit.com/tools/git-sim/viewer?seq=stash-and-hotfix |
|
Undo a hard reset with the reflog2 steps
Throw away two commits with reset --hard, then get them back from the reflog.
git reset --hard HEAD~2git reset --hard HEAD@{1}
Play the workflow →
| https://initialcommit.com/tools/git-sim/viewer?seq=undo-hard-reset |
|
Tag a release, then ship a hotfix6 steps
Tag a release, fix a bug on a hotfix branch, merge it and tag the patch release.
git tag v1.0.0git switch -c hotfix/1.0.1git commit -am "Fix login form"git switch maingit merge --no-ff hotfix/1.0.1git tag v1.0.1
Play the workflow →
| https://initialcommit.com/tools/git-sim/viewer?seq=release-and-hotfix |
| $ git merge | https://initialcommit.com/tools/git-sim/viewer?demo=merge |
| $ git rebase | https://initialcommit.com/tools/git-sim/viewer?demo=rebase |
| $ git cherry-pick | https://initialcommit.com/tools/git-sim/viewer?demo=cherry-pick |
| $ git revert | https://initialcommit.com/tools/git-sim/viewer?demo=revert |
| $ git commit --amend --no-edit | https://initialcommit.com/tools/git-sim/viewer?demo=commit-amend |
| $ git switch -c | https://initialcommit.com/tools/git-sim/viewer?demo=switch-c |
| $ git checkout | https://initialcommit.com/tools/git-sim/viewer?demo=checkout |
| $ git branch | https://initialcommit.com/tools/git-sim/viewer?demo=branch |
| $ git branch -D | https://initialcommit.com/tools/git-sim/viewer?demo=branch-d |
| $ git tag | https://initialcommit.com/tools/git-sim/viewer?demo=tag |
| $ git worktree add | https://initialcommit.com/tools/git-sim/viewer?demo=worktree |
| $ git reset --hard | https://initialcommit.com/tools/git-sim/viewer?demo=reset-hard |
| $ git restore | https://initialcommit.com/tools/git-sim/viewer?demo=restore |
| $ git restore --staged | https://initialcommit.com/tools/git-sim/viewer?demo=restore-staged |
| $ git stash | https://initialcommit.com/tools/git-sim/viewer?demo=stash |
| $ git stash pop | https://initialcommit.com/tools/git-sim/viewer?demo=stash-pop |
| $ git clean -fd | https://initialcommit.com/tools/git-sim/viewer?demo=clean |
| $ git add | https://initialcommit.com/tools/git-sim/viewer?demo=add |
| $ git commit -m | https://initialcommit.com/tools/git-sim/viewer?demo=commit |
| $ git rm | https://initialcommit.com/tools/git-sim/viewer?demo=rm |
| $ git mv | https://initialcommit.com/tools/git-sim/viewer?demo=mv |
| $ git status | https://initialcommit.com/tools/git-sim/viewer?demo=status |
| $ git fetch | https://initialcommit.com/tools/git-sim/viewer?demo=fetch |
| $ git pull | https://initialcommit.com/tools/git-sim/viewer?demo=pull |
| $ git push | https://initialcommit.com/tools/git-sim/viewer?demo=push |
| $ git remote | https://initialcommit.com/tools/git-sim/viewer?demo=remote |
| $ git clone | https://initialcommit.com/tools/git-sim/viewer?demo=clone |
| $ git log --all | https://initialcommit.com/tools/git-sim/viewer?demo=log |
| $ git reflog | https://initialcommit.com/tools/git-sim/viewer?demo=reflog |
| $ git init | https://initialcommit.com/tools/git-sim/viewer?demo=init |
| $ git config user.name | https://initialcommit.com/tools/git-sim/viewer?demo=config |
| git-sim | https://initialcommit.com/tools/git-sim |
| Learn Git | https://initialcommit.com/learn/git |
| post the private link | https://initialcommit.com/tools/git-sim/viewer |
| X | https://initialcommit.com/tools/git-sim/viewer |
| Bluesky | https://initialcommit.com/tools/git-sim/viewer |
| LinkedIn | https://initialcommit.com/tools/git-sim/viewer |
| Reddit | https://initialcommit.com/tools/git-sim/viewer |
| Hacker News | https://initialcommit.com/tools/git-sim/viewer |
| Email | https://initialcommit.com/tools/git-sim/viewer |
| The Animated Git Cheat SheetFree · Customize it · Download it · Print it→ | https://initialcommit.com/learn/git/animated-cheat-sheet?ref=git-sim-help |
| Open the cheat sheet | https://initialcommit.com/learn/git/animated-cheat-sheet?ref=git-sim-viewer-box |
| Add it to your cheat sheet | https://initialcommit.com/learn/git/animated-cheat-sheet?ref=git-sim-viewer-box |
| git-sim | https://initialcommit.com/tools/git-sim |
| Explore git-sim | https://initialcommit.com/tools/git-sim |
| Install git-sim | https://initialcommit.com/tools/git-sim#install |
| View git-sim demos | https://initialcommit.com/tools/git-sim/viewer |
|
| https://github.com/initialcommit-com |
|
| https://www.linkedin.com/in/jacob-stopak-6361b4b7 |
|
| https://www.instagram.com/initialcommit |
|
| https://www.facebook.com/initcommit |
|
| https://www.reddit.com/user/initcommit |
|
| https://twitter.com/initcommit |
| HOME | https://initialcommit.com/ |
| EXPLORE | https://initialcommit.com/learn/git/animated-cheat-sheet |
| Animated Git Cheat Sheet | https://initialcommit.com/learn/git/animated-cheat-sheet |
| Visual Git command reference | https://initialcommit.com/learn/git/visual-command-reference |
| Git command demos | https://initialcommit.com/tools/git-sim/viewer#commands |
| LEARN | https://initialcommit.com/learn/git |
| Git lessons | https://initialcommit.com/learn/git |
| Git workflow demos | https://initialcommit.com/tools/git-sim/viewer#workflows |
| Git commands | https://initialcommit.com/learn/git/commands |
| Git articles | https://initialcommit.com/learn/git/articles |
| Git basics | https://initialcommit.com/learn/git/basics |
| Working with a team | https://initialcommit.com/learn/git/team |
| Getting unstuck | https://initialcommit.com/learn/git/rescue |
| All Git topics | https://initialcommit.com/learn/git/topics |
| Python | https://initialcommit.com/cluster/python |
| Java | https://initialcommit.com/cluster/java |
| Amazon Web Services (AWS) | https://initialcommit.com/cluster/amazon-web-services-aws |
| Spring Boot | https://initialcommit.com/cluster/spring-boot |
| General Programming | https://initialcommit.com/cluster/general-programming |
| History of Programming | https://initialcommit.com/cluster/history-of-programming |
| JavaScript & Node.js | https://initialcommit.com/cluster/javascript |
| Vim | https://initialcommit.com/cluster/vim |
| DEVELOP | https://initialcommit.com/tools |
| git-sim | https://initialcommit.com/tools/git-sim |
| git-sim viewer | https://initialcommit.com/tools/git-sim/viewer |
| git-sim live | https://initialcommit.com/tools/git-sim#live |
| git-sim agentic | https://initialcommit.com/tools/git-sim#agents |
| git-sim → VS Code | https://initialcommit.com/tools/git-sim#vscode |
| git-dummy | https://initialcommit.com/tools/git-dummy |
| Devlands | https://devlands.com |
| All tools | https://initialcommit.com/tools |
| BOOKS | https://initialcommit.com/store?type=book |
| BLOG | https://initialcommit.com/blog |
| ABOUT | https://initialcommit.com/about |
| CONTACT | https://initialcommit.com/contact |
| Privacy Policy | https://initialcommit.com/privacy-policy |