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..." to update what will be committed) (use "git restore ..." 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 ..." 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..." to update what will be committed) (use "git restore ..." 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 ..." 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方法



