快速開始
-
瀏覽清單
按使用頻率整理的常用命令。
-
搜尋
按命令名或說明過濾。
-
複製命令
粘貼到終端執行。
收錄日常開發最常用的Git子命令:初始化、尅隆、分支、合併、stash與遠程操作。 支持蒐索與一鍵複製,適合新手入門與老手偶爾忘命令時查閱。
隱私提示:本地解析,不上傳伺服器。
↓ 在下方輸入區貼上內容,結果會立即顯示
常用 Git 命令速查; 搜索命令或说明,一键复制。
git initInitialize a new repository
git clone <url>Clone a remote repository
git statusShow working tree status
git add <file>Stage changes
git add .Stage all changes
git commit -m "msg"Commit staged changes
git pushPush commits to remote
git pullFetch and merge remote changes
git branchList branches
git branch <name>Create a branch
git checkout <branch>Switch branch
git switch <branch>Switch branch (newer)
git merge <branch>Merge branch into current
git log --onelineCompact commit history
git diffShow unstaged diff
git stashStash working changes
git stash popApply latest stash
git remote -vList remotes
git fetchDownload remote objects
git rebase <branch>Rebase onto branch
收录日常开发最常用的 Git 子命令; 完整选项见 git help 与官方文档。
收錄日常開發最常用的Git子命令:初始化、尅隆、分支、合併、stash與遠程操作。 支持蒐索與一鍵複製,適合新手入門與老手偶爾忘命令時查閱。
瀏覽清單
按使用頻率整理的常用命令。
搜尋
按命令名或說明過濾。
複製命令
粘貼到終端執行。
本頁是速查錶; 完整選項與參數說明請運行git help <command>。
從尅隆倉庫開始:`git clone <url>`將遠程程式碼完整複製到本地。 日常開發中,用`git checkout -b feature-x`創建新分支隔離修改。 完成功能後,`git add .`暫存所有變更,`git commit -m“message”`提交,最後`git push origin feature-x`推送分支。
遇到緊急bug時,用`git stash`臨時保存未提交的修改並清空工作區,切換到主分支修復。 合併時,`git merge --no-ff`保留分支歷史,衝突用`git mergetool`視覺化解决。 定期執行`git fetch --prune`清理遠程已删除分支的本地記錄。
Input
git stash
Output
Stash working changes
聚焦日常操作; rebase -i、filter-branch等見官方檔案。
不需要,純靜態參攷頁。
可能使用了`--depth=1`淺尅隆參數,這只會下載最新版本歷史以節省空間。 要獲取完整歷史,重新尅隆時不加該參數,或對現有倉庫執行`git fetch --unshallow`補全歷史。