2022年4月15日 星期五

Git 指令

乾合併


--no-ff 不要快速合併
--no-commit 不要直接發 commit ,先進暫存
git merge master --no-commit --no-ff
(將 master Merge 到當前的 branch)
git merge main --no-commit --no-ff
(將 main Merge 到當前的 branch)


Remote


檢視 Remote 路徑
git remote -v
更新 Remote 路徑
git remote set-url origin {URL}
(would clobber existing tag) 更新 Local Tag 問題
git fetch --tags -f


Worktree


建立 Branch 並另開工作目錄
git worktree add -b worktree_branch ../worktree_folder master
檢視目前的 Worktree 清單
git worktree list
刪除 Worktree ,直接刪除目錄,然後執行
git worktree prune