git安装使用

git 安装与使用

Git官网

git说明

https://mp.weixin.qq.com/s/Bf7uVhGiu47uOELjmC5uXQ

删除 git:
1、控制面板 > 卸载git
2、删除 git 环境变量

配置文件:

git config --global user.name "名字"
git config --global user.emial "邮箱"

在 c盘/用户 的文件夹里有一个 .gitconfig 文件,里面是配置好

[core]
	editor = \"C:\\APP\\vscode\\install\\Microsoft VS Code\\bin\\code\" --wait
[user]
	name = xx
	email = xxx@xx.com

查看git配置
git config -l

diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=D:/App/Git/install/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
core.editor="C:\APP\vscode\install\Microsoft VS Code\bin\code" --wait
user.name=xxx
user.email=xxx@xxx.com

查看系统配置
git config --system --list

diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=D:/App/Git/install/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master

查看当前用户配置
git config --global --list

core.editor="C:\APP\vscode\install\Microsoft VS Code\bin\code" --wait
user.name=xx
user.email=xx@xx.com

git 基本理论(核心)
提交
1、本地工作区文件通过 git add 提交到暂存区
2、暂存区文件通过 git commit提交到本地仓库
3、本地仓库文件通过git push 提交到远程仓库

下拉
1、远程仓库文件通过git pull下拉到本地仓库
2、本地仓库文件通过git reset回滚到暂存区
3、暂存区文件通过git checkout剪出到本地工作区文件夹

运行
1、git inti 初始化
此时会有一个隐藏目录 .git 文件夹
在这里插入图片描述

1、生成/添加SSH公钥

https://gitee.com/help/articles/4181#article-header0

2、登录gitee,打开个人中心 > 安全设置 > 添加SSH公钥

# 列出所有本地分支
git branch

# 列出所有远程分支
git branch -r

# 新建一个分支,但依然停留在当前分支
git branch [branch-name]

# 新建一个分支,并切换到该分支
git checkout -b [branch]

# 合并指定分支到当前分支
$ git merge [branch]

# 删除分支
$ git branch -d [branch-name]

# 删除远程分支
$ git push origin --delete [branch-name]
$ git branch -dr [remote/branch]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值