Git 提交使用者資訊修改指令碼

2021-09-11 15:14:27 字數 752 閱讀 4455

當你錯用了公司的郵箱作為提交者的資訊在開源的 git 倉庫上提交了**時,可使用以下指令碼修改,修改完會生成一系列全新的 commit,與原先的 commit 平行,此時再git push -f即可。

#!/bin/sh

git filter-branch --env-filter '

an="$git_author_name"

am="$git_author_email"

cn="$git_committer_name"

cm="$git_committer_email"

if [ "$git_committer_email" = "gzxieyunjia@corp.****.com" ]

then

cn="yjxie"

cm="[email protected]"

fiif [ "$git_author_email" = "gzxieyunjia@corp.****.com" ]

then

an="yjxie"

am="[email protected]"

fi export git_author_name="$an"

export git_author_email="$am"

export git_committer_name="$cn"

export git_committer_email="$cm"

'

Git修改已提交使用者資訊

修改某一專案配置 終端進入到專案所在目錄下,執行以下命令 git config user.name cc git config user.email cc cc.cc 修改全域性配置 開啟終端,執行以下命令 git config global user.name cc git config glob...

修改提交使用者名稱郵箱

用git commit進行了一次版本提交,並推送到了遠端倉庫,若是想修改此次提交者使用者名稱郵箱可以這樣操作 git commit amend author newname 丟棄上一次版本提交,然後進行一次同上次一樣的新版本提交 兩次提交的commit id不同 git push f origin ...

Git 修改已提交的郵箱和使用者資訊

實際過程中有的時候本地配置資訊郵箱有誤,導致git commit 提交作者的資訊有誤,這個時候就需要進行修改 git config list user.email user.name 修改git 配置資訊git config global user.email com修改已經提交的作者資訊 網上給出...