Git工具配置

git查看配置

git config --list

git设置邮箱与作者

# git设置邮箱与作者(全局)
git config --global user.email "123@456.com"
git config --global user.name "myname"

# git设置邮箱与作者(仓库)
git config user.email "project_email@example.com"
git config user.name "Project Author"

# 验证配置:在仓库目录下运行 git config --list,确认配置项前缀为 user. 且无 --global 标记
# 仓库级配置覆盖全局配置,Git提交时优先使用仓库级配置。

设置默认分支名称

# 设置全局默认分支名为"main"
git config --global init.defaultBranch main

# 验证配置是否生效
git config --global --get init.defaultBranch  # 应输出"main"

git删除配置

# git删除仓库配置
git config --unset user.email

# git删除全局配置
git config --global --unset user.email
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇
error: Content is protected !!