mirror of
https://github.com/privacyguides/i18n.git
synced 2026-07-31 10:50:58 +00:00
1.8 KiB
1.8 KiB
title, description
| title | description |
|---|---|
| Git 使用建議 | 網站撰稿人如何更好利用 Git 的指南。 |
如果想直接在 github.com 網頁編輯器對本站進行修改,則無須擔心此處的建議。 如您使用本地端開發或者您是一位常駐的網站編輯者(可能使用本地端開發),請參考以下建議。
開啟 SSH 金鑰提交簽署
可使用現有的SSH 金鑰簽署或 建立新金鑰one。
-
設定 Git 客戶端以預設簽署提交與標籤(移除
--global以便只對此存取庫作簽署):git config --global commit.gpgsign true git config --global gpg.format ssh git config --global tag.gpgSign true -
透過下方指令來設定簽署 Git 的 SSH 金鑰,把
/PATH/TO/.SSH/KEY.PUB替換成存放公鑰的路徑,如/home/user/.ssh/id_ed25519.pub:git config --global user.signingkey /PATH/TO/.SSH/KEY.PUB
確認 加入您 GitHub 帳戶中的 SSH 金鑰 簽署金鑰 (其不同於驗證金鑰)。
Rebase on Git pull
使用 git pull --rebase 取代 git pull 以從 Github 把變動提取回本地端機器。 這種方式會使本地端的變動總在 Github 之上,而您可避免合併提交(本取存庫亦不允許)。
可將它設為預設行為:
git config --global pull.rebase true
發送提取請求前,先自 main重整。
如果是在自建的旁支工作,提取請求前先執行這些指令:
git fetch origin
git rebase origin/main