tools.git-cheatsheet.sectionInit
git inittools.git-cheatsheet.descInitInitgit init <directory>tools.git-cheatsheet.descInitInitDirgit config --global user.name "Name"tools.git-cheatsheet.descInitUserNamegit config --global user.email "email"tools.git-cheatsheet.descInitUserEmailgit config --listtools.git-cheatsheet.descInitConfigListgit clone <url>tools.git-cheatsheet.descInitClonegit clone <url> <directory>tools.git-cheatsheet.descInitCloneDirtools.git-cheatsheet.sectionBasic
git statustools.git-cheatsheet.descBasicStatusgit add <file>tools.git-cheatsheet.descBasicAddFilegit add .tools.git-cheatsheet.descBasicAddAllgit add -ptools.git-cheatsheet.descBasicAddPatchgit commit -m "message"tools.git-cheatsheet.descBasicCommitgit commit --amendtools.git-cheatsheet.descBasicAmendgit commit --amend --no-edittools.git-cheatsheet.descBasicAmendNoEditgit rm <file>tools.git-cheatsheet.descBasicRmgit mv <old> <new>tools.git-cheatsheet.descBasicMvtools.git-cheatsheet.sectionBranch
git branchtools.git-cheatsheet.descBranchListgit branch <name>tools.git-cheatsheet.descBranchCreategit branch -d <name>tools.git-cheatsheet.descBranchDeletegit branch -D <name>tools.git-cheatsheet.descBranchForceDeletegit branch -rtools.git-cheatsheet.descBranchRemotegit checkout -b <name>tools.git-cheatsheet.descBranchCheckoutBgit switch <name>tools.git-cheatsheet.descBranchSwitchgit switch -c <name>tools.git-cheatsheet.descBranchSwitchCgit merge <branch>tools.git-cheatsheet.descBranchMergegit merge --no-ff <branch>tools.git-cheatsheet.descBranchMergeNoFFgit rebase <branch>tools.git-cheatsheet.descBranchRebasegit rebase -i HEAD~ntools.git-cheatsheet.descBranchRebaseItools.git-cheatsheet.sectionRemote
git remote add origin <url>tools.git-cheatsheet.descRemoteAddgit remote -vtools.git-cheatsheet.descRemoteVgit remote remove <name>tools.git-cheatsheet.descRemoteRemovegit pushtools.git-cheatsheet.descRemotePushgit push -u origin <branch>tools.git-cheatsheet.descRemotePushUgit push --force-with-leasetools.git-cheatsheet.descRemotePushForcegit pulltools.git-cheatsheet.descRemotePullgit pull --rebasetools.git-cheatsheet.descRemotePullRebasegit fetchtools.git-cheatsheet.descRemoteFetchgit fetch --alltools.git-cheatsheet.descRemoteFetchAlltools.git-cheatsheet.sectionHistory
git logtools.git-cheatsheet.descHistoryLoggit log --onelinetools.git-cheatsheet.descHistoryLogOnelinegit log --graph --onelinetools.git-cheatsheet.descHistoryLogGraphgit log -ptools.git-cheatsheet.descHistoryLogPgit log --author="name"tools.git-cheatsheet.descHistoryLogAuthorgit difftools.git-cheatsheet.descHistoryDiffgit diff --stagedtools.git-cheatsheet.descHistoryDiffStagedgit diff <branch1>..<branch2>tools.git-cheatsheet.descHistoryDiffBranchgit show <commit>tools.git-cheatsheet.descHistoryShowgit blame <file>tools.git-cheatsheet.descHistoryBlametools.git-cheatsheet.sectionUndo
git reset HEAD <file>tools.git-cheatsheet.descUndoResetgit reset --soft HEAD~1tools.git-cheatsheet.descUndoResetSoftgit reset --hard HEAD~1tools.git-cheatsheet.descUndoResetHardgit revert <commit>tools.git-cheatsheet.descUndoRevertgit checkout -- <file>tools.git-cheatsheet.descUndoCheckoutgit restore <file>tools.git-cheatsheet.descUndoRestoregit stashtools.git-cheatsheet.descUndoStashgit stash poptools.git-cheatsheet.descUndoStashPopgit stash listtools.git-cheatsheet.descUndoStashListgit stash droptools.git-cheatsheet.descUndoStashDropgit clean -fdtools.git-cheatsheet.descUndoCleantools.git-cheatsheet.sectionTag
git tagtools.git-cheatsheet.descTagListgit tag <name>tools.git-cheatsheet.descTagCreategit tag -a <name> -m "msg"tools.git-cheatsheet.descTagAnnotategit tag -d <name>tools.git-cheatsheet.descTagDeletegit push --tagstools.git-cheatsheet.descTagPushgit push origin :refs/tags/<name>tools.git-cheatsheet.descTagDeleteRemotetools.git-cheatsheet.sectionAdvanced
git cherry-pick <commit>tools.git-cheatsheet.descAdvCherryPickgit bisect starttools.git-cheatsheet.descAdvBisectStartgit bisect good/badtools.git-cheatsheet.descAdvBisectGoodBadgit archive --format=zip HEAD > out.ziptools.git-cheatsheet.descAdvArchivegit submodule add <url>tools.git-cheatsheet.descAdvSubmoduleAddgit submodule update --inittools.git-cheatsheet.descAdvSubmoduleUpdategit worktree add <path> <branch>tools.git-cheatsheet.descAdvWorktreegit reflogtools.git-cheatsheet.descAdvReflog工具说明
Git 指令速查手冊,涵蓋初始化、提交、分支、合併、遠端、撤銷等常用操作,支援搜尋過濾,適合 Git 新手和日常查閱。
gitcommand命令速查cheatsheet版本控制