Git基础命令

Git配置

1. 查看当前的 git 配置信息

1
git config --list

4. 查看 git 用户名 或 邮箱

1
2
3
git config --global user.name            # 查询git所使⽤的用户名
 
git config --global user.email           # 查询git所使⽤的email

# 注: --global 表示全局, 没有--global表示只查询在当前项目中的配置

5. 全局配置用户名(设置 git 使⽤者名称)

 

1
git config --global user.name "username"

6. 设置 (配置)全局邮箱

1
git config --global user.email "11111111@qq.com"

  

 

Git操作

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#克隆远程分支
git clone  http地址#签出远程分支
git checkout develop/80396132<br><br>#从master 新建 dev
git checkout -b devlop/80396132
 
#推送到远程
git push origin devlop/80396132
 
#获取远程分支
git fetch origin develop/80396132
 
#从develop/80396132新建feature/80396132
git checkout -b feature/80396132 develop/80396132
 
#推送
git push origin 。。。
 
#合并feature到develop
git checkout develop/80396132
git merge feature/80396132
 
#提交
git commit -m '信息'
 
#提交无需add
git commit -a
 
#git删除本地分支
git branch -d develop/80396132
 
#删除远程分支
git push origin --delete feature/80396132

 

 

posted @   我来偷家了  阅读(5)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
点击右上角即可分享
微信分享提示