天天看點

git兩個賬号切換_Git切換賬号方法

Windows修改Git賬号

打開控制台(Win+s快捷鍵),輸入:control

指令行:control

git兩個賬号切換_Git切換賬号方法

憑證管理器

使用[憑證管理器]修改git賬号:

git兩個賬号切換_Git切換賬号方法

全局範圍修改賬号

運作git config --global選項:$ git config --global user.name "John Doe"

$ git config --global user.email "[email protected]"

項目範圍修改

針對項目修改git賬号:$ git config user.name "John Doe"

$ git config user.email "[email protected]"

單次送出修改作者

僅針對即将到來commit,可覆寫下一個送出者資訊:git commit --author="John Doe "

--amend選項對最近一次送出執行修改。git commit --amend --author="John Doe "

git Interactive Rebase

這些都不能滿足,可嘗試 git Interactive Rebase。

可以完成任何事情,也意味着很容易搬石頭砸自己的腳,使用前應先了解它。

第一步:

選擇一個commit 記錄(git log),将commit id傳遞給rebase指令: