初次配置 Git

2021-08-22 00:18:44 字數 809 閱讀 6531

在開始使用 git 之前,你需要配置 git。在命令列工具中執行以下每行,確保所有選項都已被配置好。

# 設定你的 git 使用者名稱

git config --global user.name ""

# 設定你的 git 郵箱

git config --global user.email ""

# 確保 git 輸出內容帶有顏色標記

git config --global color.ui auto

# 對比顯示原始狀態

git config --global merge.conflictstyle diff3

git config --list

最後乙個配置步驟是讓 git 能與你的**編輯器結合使用。以下是三個最熱門的**編輯器。如果你使用的是其他編輯器,則在 google 中搜尋「修改 git 預設編輯器為 x 編輯器」(將 x 替換為你的**編輯器的名稱)。

vscode 設定

git config --global core.editor

"code --wait"

atom editor 設定

git config --global core.editor

"atom --wait"

sublime text 設定

git config --global core.editor

初次配置git

安裝完成後,還需要最後一步設定,在命令列輸入 git config global user.name your name git config global user.email email example.com 然後在本地建立乙個版本庫 1.新建乙個空的資料夾 目錄中最好沒有中文 2.進入這個目...

Git 初次配置

git config global user.name git config global user.email 1.2檢查配置資訊 git config list 會列出當前所有git配置 2.0上傳本地專案到遠端倉庫 2.1 先進入專案資料夾 通過命令 git init 把這個目錄變成git可以...

git 初次執行git前的配置

當前系統已經安裝好了git。現在我們來定製git環境。每台計算機上只需要配置一次,程式公升級前會保留配置資訊。你可以在任何時候再次通過執行命令來修改它們 git自帶乙個git config的工具來幫助設定控制git外觀和行為的配置變數。這些變數儲存在三個不同的位置。每乙個級別會覆蓋上一級別的配置,所...