git配置

lenovo@pidansourouzhou MINGW64 /d
$ cd /d/我的桌面/

lenovo@pidansourouzhou MINGW64 /d/我的桌面
$ ls
'IntelliJ IDEA Community Edition 2021.3.lnk'*   mysql/
 JAVA测试.docx                                  mysql-5.7.17.msi
 Typora.lnk*                                    实习/
'Visual Studio Code.lnk'*                       毕业设计/
'WPS Office.lnk'*                               金山打字通.lnk*
 desktop.ini                                    金山文档.lnk*
 jdk1.8中文百度.CHM                             阿里云盘.lnk*
 myproject/

lenovo@pidansourouzhou MINGW64 /d/我的桌面
$ cd myproject/

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject
$ git init
Initialized empty Git repository in D:/我的桌面/myproject/.git/

配置

# 显示当前的Git配置
$ git config --list
​
# 编辑Git配置文件
$ git config -e [--global]
​
# 设置提交代码时的用户信息
$ git config [--global] user.name "[name]"
$ git config [--global] user.email "[email address]"
​
​
lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ 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:/Git/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.email=皮蛋瘦肉周
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git config --global user.name "皮蛋瘦肉周"

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git config --global user.email "1938178473@qq.com"

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   helloworld.java

no changes added to commit (use "git add" and/or "git commit -a")

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git add helloworld.java

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git status
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   helloworld.java


lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git commit -m "初始化main方法"
[master f152a36] 初始化main方法
 1 file changed, 5 deletions(-)

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git status
On branch master
nothing to commit, working tree clean
lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$  git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   helloworld.java

no changes added to commit (use "git add" and/or "git commit -a")

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git add helloworld.java

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$  git status
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   helloworld.java


lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$  git commit -m "打印HelloWorld"
[master 622d3aa] 打印HelloWorld
 1 file changed, 5 insertions(+)

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$  git status
On branch master
nothing to commit, working tree clean

lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git log
commit 622d3aa9083c1c214ae67a20cee53caebf9b142c (HEAD -> master)
Author: 皮蛋瘦肉周 <1938178473@qq.com>
Date:   Thu Mar 10 21:43:34 2022 +0800

    打印HelloWorld

commit f152a363dab1ed09d37837d36575f5ee3082a147
Author: 皮蛋瘦肉周 <1938178473@qq.com>
Date:   Thu Mar 10 21:33:46 2022 +0800

    初始化main方法
lenovo@pidansourouzhou MINGW64 /d/我的桌面/myproject (master)
$ git reflog
622d3aa (HEAD -> master) HEAD@{0}: commit: 打印HelloWorld
f152a36 HEAD@{1}: commit: 初始化main方法

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值