Git檢視本地配置資訊

2021-09-11 16:21:56 字數 1260 閱讀 2774

config 配置指令

git config
config 配置有system級別 global(使用者級別) 和local(當前倉庫)三個 設定先從system-》global-》local 底層配置會覆蓋頂層配置 分別使用–system/global/local 可以定位到配置檔案

檢視系統config

git config --system --list
檢視當前使用者(global)配置

git config --global  --list
檢視當前倉庫配置資訊

git config --local  --list
檢視user.name

git config user.name
檢視user.email

git config user.email
修改user.name

git config --global --replace-all user.name "your user name"
修改user.email

git config --global --replace-all user.email"your user email"
git其他命令

1、強制推送(慎用,除非你認為其他衝突等可以丟棄 或者不是很重要)

git push -- force
2、常用命令

# 初始化 在工作路徑上建立主分支

git init

# 轉殖遠端倉庫

git clone 位址

# 轉殖分支的**到本地

git clone -b 分支名 位址

# 檢視狀態

git status

# 將某個檔案存入暫存區

git add 檔名

# 把b和c存入暫存區

git add b c

# 將所有檔案提交到暫存區

git add .

# 乙個檔案分多次提交

git add -p 檔名

# 提交到倉庫

git commit -m "提交的備註資訊"

git配置資訊

一 概述 安裝過git bash且執行過git的任何乙個配置命令後,在家目錄 c users administrator 中會有乙個.gitconfig檔案 二 配置作者資訊 不標識自己是誰,git不能用 大多數情況是全域性配置作者資訊,也可以在某個倉庫中配置作者資訊。git config glob...

git config 檢視配置資訊

config 配置指令 1 git config config 配置有system級別 global 使用者級別 和local 當前倉庫 三個 設定先從system global local 底層配置會覆蓋頂層配置 分別使用 system global local 可以定位到配置檔案 檢視系統con...

Git查詢配置資訊

目錄 git配置變數 查詢配置資訊 查詢某一項配置 git自帶乙個git config工具來幫助設定控制git外觀和行為的配置變數。通常情況下,這些配置儲存在 gitconfig檔案中,該檔案僅針對當前使用者。可以傳遞 global選項讓 git 讀寫此檔案。可以使用 git config list...