git命令

  1. 查看配置
git congfig --list

结果:

C:\Users\CXP>git config --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:/work/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
user.name=Angelou
user.email=******@qq.com
push.default=simple
  1. 配置邮箱和昵称
    –global 参数保证在当前系统任何一个项目默认使用 name 和 email
git config --global user.name "Angelou"
git config --global user.email "******@qq.com"

没有 --global 只能在某个已初始化git的项目下执行,指定这个项目的 name 和 email

git config user.name "Angelou"
git config user.email "******@qq.com"
  1. 克隆项目
git clone http:www.xxxxx.git
  1. 克隆XX分支
git clone -b 分支名称 http:www.xxxxx.git
  1. git存储用户名密码
    默认情况在第一次输入用户名密码之后就会存储,下次不需要在输入,如果没有存储,执行以下操作
git config --global credential.helper store

然后再push pull等,不需要输入密码

  1. 查看当前分支是基于那个分支创建的
#show是缺省值,下面命令等同于git reflog 分支名 
git reflog show 分支名 
#查看merge和checkout记录 
git reflog show --date=local | grep 分支名

推荐使用第二种,因为第一种仅适用于查看从远程分支checkout到本地的分支,如果是本地直接新建分支,则第一种展示的create from HEAD,第二种可看最早时间的记录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值