只有累積,沒有奇蹟

2018年11月17日 星期六

[Git] Username and Email must be set before commit

發生情境

最近在新筆電安裝開發常用的軟體,安裝完Tortoise GIT版小烏龜之後無法 commit code 錯誤訊息如下 : 
    User name and email must be set before commit. Do you want to set these now ?    

這訊息與登入憑證 (login credentials) 無關,在 Git 要進行 Commit 的動作時需要一併提交 Name 和 eMail 等資訊這狀況遇過好多次,但每次都跳過直接 google 該怎麼解決,事不過三這次就把它紀錄下來方便下次換電腦時遇到使用(是要換幾次工作 咦?),以下提供兩種解決方式

透過指令設定 Name & Email  

1. 開啟Command Line (cmd)
2. 輸入下列指令設定 Name & Email

  • git config --global user.name "Your Name"
  • git config --global user.email "Your Email"


透過介面設定  

1. 開啟小烏龜 > Settings
2. User Info 區域修改你所要設定的 Name & Email


3. 輸入完畢按下套用,打完收工


參考

https://stackoverflow.com/questions/21049090/just-starting-with-tortoisegit-why-does-it-need-my-email-for-a-local-repository


Related Posts:

  • [Git] 如何更新 GitHub Fork 的 repository 前言 GitHub 是全球最大的 Git Server,在 GitHub 上面有很多大神貢獻的 opensource 開源專案內容,看到覺得不錯有興趣的 repository 可以 fork 下來研究,repository 在 fork 下來之後會停留在當下不會自動更新,一段時間之後可能就會與原始 repository 的越差越多,自己在過去遇到這問題時候都是直接砍掉 repo 在重新 fork (砍掉重練概念),但其實在 GitHub 官方文件… Read More
  • [CheatSheets] Git commands 前言  Git 指令小抄表 source Git Commands and Best Practices Cheat Sheet Git commands … Read More
  • [Git] Git Client 版本管理工具 - Fork前言 相信開發者都聽過或正在 Git 進行版本控管,Git 是一個分散式版本控管系統,在 Windows OS 中支援 Git 的免費工具比較常見的有 TortoiseGit、SourceTree 或是 GitKraken 幾種,最近主管分享另外一套強大的且免費的 Git 版控工具 Fork,在官網上的介紹也十分簡潔有力,a fast and friendly git client for Mac and Windo… Read More
  • [VS2017] 如何用 Visual Studio 2017 專案設定 .gitignore 前言 一般在開發的時候,會有一些檔案是不需要 commit 到 Git 版控工具裡面,舉例來說當 VS build 完專案會產生 dll 存放在在 bin 目錄底下,或是 packages 資料夾 ( Nuget 下載的套件 ),甚至一些機密的資料或是 config 檔案,這些內容都不需要 Commit 到 git 中,以上需求都可以透過 .gitignore 定義要忽略的文件或檔案,這篇文章簡單紀錄在Vi… Read More
  • [Git] Username and Email must be set before commit發生情境 最近在新筆電安裝開發常用的軟體,安裝完Tortoise GIT版小烏龜之後無法 commit code ,錯誤訊息如下 :      User name and email must be set before commit. Do you want to set these now ?     這訊息與登入憑證 (login credentials) 無關,在 … Read More

0 意見:

張貼留言

Copyright © 2025 m@rcus 學習筆記 | Powered by Blogger

Design by Anders Noren | Blogger Theme by NewBloggerThemes.com