乱码三千 – 分享实用IT技术

乱码三千 – 码出一个新世界


  • 首页

  • 归档

  • 搜索

Mac快速开启http本地服务共享文件

发表于 2022-07-11

前言

有时候我们可能需要用手机访问电脑上的文件, 或者用手机测试电脑上编写的程序

此时 在同一个wifi网络的前提下我们可以这么做:

第一种 使用python

直接使用自带python工具开启http服务, 首先打开终端, 进入需要共享的目录,然后运行以下代码即可:

1
python -m SimpleHTTPServer  8000

如果是python3, 则将SimpleHTTPServer改成http.server

1
python -m http.server 8000

image-20220711144617056

紧接着就可以在浏览器上访问了: 在地址栏输入http://127.0.0.1:8000/或者http://localhost:8000/

局域网设备访问

如果局域网内其他设备访问, 则需要先获取到Mac的局域网Ip, 我们可以从系统偏好设置中的网络选项中查看到IP地址:

image-20220711145144222

然后使用http://局域网ip:8000这个地址就可以供其他设备访问啦

第二种 使用Apache

服务开启

Mac本身自带了Apache服务, 我们无需另外安装, 直接开启即可, 打开终端输入以下指令开启:

1
sudo apachectl start

打开服务后, 浏览器输入以下地址即可访问:

1
2
3
4
5
http://127.0.0.1

或者

http://localhost/

img

出现以上页面表示服务启动成功

此时 Apache默认的服务器根目录在:

1
/Library/WebServer/Documents

我们可以将需要共享的文件存放到该目录下, 比如我存放了一张名为111.gif的图片, 那么访问http://127.0.0.1/111.gif即可查看该图

Apache配置目录浏览

可是上面这种操作并不符合我们的预期, 我们想要输入地址后直接列出该目录下的所有文件

这需要对Apache配置文件中进行修改, 其配置文件路径为:

1
/etc/apache2/

文件名为httpd.conf, 修改之前建议大家进行一次备份

打开该文件, 在Options 后面追加一句Indexes

image-20220711151550133

重启apache服务后, 浏览器输入地址就能查看目录了

image-20220711151755973

每次更改了配置, 需要重启服务才能生效, 重启指令如下:

1
2
//重启apache:    
sudo apachectl restart

Apache其他配置

  1. 更改服务根目录

    搜索DocumentRoot关键字

    image-20220711152308158

  2. 更改访问端口

    搜索ServerName关键字, 去掉改行注释, 然后改为ServerName localhost:端口号或者ServerName 127.0.0.1:端口号

    image-20220711152426884

  3. 开启对PHP的支持

    搜索LoadModule, 去掉php7注释

    image-20220711152834896

局域网设备访问

Apache默认开启的是80端口, 因此直接http://局域网ip访问即可

服务关闭

服务一旦开启 每次电脑启动后Apache都会自动跟着开启

平常不用的时候我们可以关闭服务, 减少资源消耗, 关闭指令如下:

1
2
//关闭apache:    
sudo apachectl stop

总结

两种方式, 各有各的好处, apache的强大是毋庸置疑的, 如果只是任意文件夹共享, 直接使用python的方法会更加方便一些

本文为作者原创转载时请注明出处 谢谢

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

Mac识别二维码 无需安装第三放应用

发表于 2022-07-09

前言

我们在浏览网页的时候经常会碰到二维码扫描需求, 一般情况下 我们会考虑将二维码图片发送到手机上 然后用手机识别 或者干脆装个第三方扫码软件

为了方便 (主要是懒) 接下来给大家介绍一种使用Safari浏览器二维码识别的方法

具体操作

第一步

选中要识别的二维码图片,把它拖到Safar浏览器打开。

第二步

随后右键点击二维码,选择在新标签页中打开...

新标签页中打开的就是二维码中的内容

是不是很简单 赶紧试试吧~

本文为作者原创转载时请注明出处 谢谢

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

img标签随机获取高质量图片

发表于 2022-07-09

起因

博主打算为自己在vps上挂载的服务, 建立一个导航页, 于是写一个静态页面, 贴了几个超链接

后来, 感觉不美观, 就放了几张图片

服务器存储的图片看了几遍就看腻了, 于是找了一个高质量图片的api, 每次打开导航页都能看到随机的封面

开源图片api的使用

  • 我想获得300*300, 关于book和library的图片”

    1
    https://source.unsplash.com/300x300/?book,library
  • 将随机图片嵌入到html中

    1
    <img src="https://source.unsplash.com/300x300/?book,library">

随机封面效果展示

  • 第一次打开:

img

  • 第二次打开

img

  • 第三次打开

img

  • 第N次打开…

img

随机封面测试地址(页面每次刷新,都能看到不同的封面)

页面部分源码:

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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<body>
<section class="clearfix">
<div class="item">
<a href="http://git.zhaoolee.com">
<img src="https://source.unsplash.com/300x300/?program" alt="">
<div class="item-title">私有Git仓库</div>
</a>
</div>


<div class="item">
<a href="http://cloud.zhaoolee.com">
<img src="https://source.unsplash.com/300x300/?document" alt="">
<div class="item-title">私有云网盘</div>
</a>
</div>

<div class="item">
<a href="https://www.jianshu.com/u/c5d047065c42">
<img src="https://source.unsplash.com/300x300/?book,library" alt="">
<div class="item-title">简书主页</div>
</a>
</div>

<div class="item">
<a href="https://github.com/zhaoolee">
<img src="https://source.unsplash.com/300x300/?github" alt="">
<div class="item-title">Github主页</div>
</a>
</div>

<div class="item">
<a href="">
<img src="https://source.unsplash.com/300x300/?cartoon" alt="">
<div class="item-title">在线爬虫(建设中)</div>
</a>
</div>


<div class="item">
<a href="">
<img src="https://source.unsplash.com/300x300/?beauty" alt="">
<div class="item-title">资源分享(建设中)</div>
</a>
</div>
</section>
</body>

小结:

  • 使用随机化开源图片封面, 能让我们每次打开页面都有惊喜.
  • 对于刚刚接触前端的小伙伴, 使用开源的图片库, 能让你的页面更加丰富多彩, 提升学习的兴趣.
  • 对于前端老司机,可以获取定制化的开源图片, 提升页面展示效果.
  • 如果你对图片的质量有极致的追求,https://source.unsplash.com 提供了丰富的接口参数设置,可以定制化随机图片的范围, 当然也可以在unsplash.com 注册一个账号, 订阅特别主题的图片

本文转载自: https://cloud.tencent.com/developer/article/1344365?from=15425

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

给Hexo添加Github贡献日历图

发表于 2022-07-08

图示

样式一

Zfour's github stats

样式二

样式三

小冰的插件效果

接下来给大家介绍它们的实现方法

代码实现

第一种

只需将username的值设置为你的github用户名即可:

1
https://github-readme-stats.vercel.app/api?username=github用户名

然后以图片的形式进行加载:

1
![](https://github-readme-stats.vercel.app/api?username=github用户名)

如果是放置在html中, 替换用户名后 拷贝以下代码:

1
<img src="https://github-readme-stats.vercel.app/api?username=github用户名" referrerpolicy="no-referrer" ">

项目GitHub: github-readme-stats

第二种

和第一种类似, 尾部改成github用户名即可

1
https://ghchart.rshah.org/github用户名

然后以图片的形式进行加载:

1
![](https://ghchart.rshah.org/github用户名)

如果是放置在html中, 替换用户名后 拷贝以下代码:

1
<img src="https://ghchart.rshah.org/github用户名"  referrerpolicy="no-referrer" ">

项目GitHub: githubchart-api

第三种

这种是以hexo插件的形式实现, 具体步骤如下:

  1. 安装插件

    1
    npm i hexo-githubcalendar --save
  2. hexo根目录下的config文件添加如下配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    # Ice Kano Plus_in
    # Hexo Github Canlendar
    # Author: Ice Kano
    # Modify: Lete乐特
    githubcalendar:
    enable: true
    enable_page: /
    user: 你的github用户名
    layout:
    type: id
    name: recent-posts
    index: 0
    githubcalendar_html: '<div class="recent-post-item" style="width:100%;height:auto;padding:10px;"><div id="github_loading" style="width:10%;height:100%;margin:0 auto;display: block"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform></path></svg></div><div id="github_container"></div></div>'
    pc_minheight: 280px
    mobile_minheight: 0px
    color: "['#ebedf0', '#fdcdec', '#fc9bd9', '#fa6ac5', '#f838b2', '#f5089f', '#c4067e', '#92055e', '#540336', '#48022f', '#30021f']"
    api: https://python-github-calendar-api.vercel.app/api
    # api: https://python-gitee-calendar-api.vercel.app/api
    calendar_js: https://cdn.jsdelivr.net/gh/Zfour/hexo-github-calendar@1.21/hexo_githubcalendar.js
    plus_style: ""

    将user属性修改为你的github用户名即可,

    • 其他属性用法可参见《教程:hexo-githubcalendar 插件 1.0》

    • 涉及主题: hexo-theme-butterfly

    • 插件GitHub: hexo-github-calendar

本文为作者原创转载时请注明出处 谢谢

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

解决图片的防盗链导致图片显示不出来

发表于 2022-07-08

前言

你平常有可能将图片存放到github、gitee 或者博客园 简书等等地方, 供静态博客使用, 除了github之外 大部分国内的网站都设置了图片防盗链

如果直接使用会导致图片无法显示

解决防盗链的问题其实也非常简单

解决方案

在html的head标签中添加如下代码即可:

1
<meta name="referrer" content="never">

如果你只想处理某部分图片, 可以针对性设置, 比如:

1
<img src="xxxx.jpg" referrerPolicy="no-referrer" />

批量替换图片域名

偶尔图床CDN挂了需要更换域名, 一些文章存放在数据库,比如wordpress网站 为了方便 可以采用js动态替换的方式, 将以下代码拷贝到html页脚标签中即可

1
2
3
4
5
6
7
8
<script>

let context = Array.prototype.map.call(document.images, (event) => {
event.src = event.src.replace("cdn.jsdelivr.net/gh/xxx/xxx", "raw.staticdn.net/xxx/xxx/master")

});

</script>

另外还可以动态添加meta标签

1
2
3
4
5
6
7
8
9
10
11
const addMeta = (name, content) => {
const meta = document.createElement('meta');
meta.content = content;
meta.name = name;
document.getElementsByTagName('head')[0].appendChild(meta);
};

addMeta(
'referrer',
'never',
);

本文为作者原创转载时请注明出处 谢谢

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

Android锁屏息屏状态下弹出界面

发表于 2022-07-07

前言

最近公司客户端项目需要支持锁屏息屏状态下弹出应用界面, 类似于微信来电显示, 实现方法很简单, 如下:

实现步骤

第一步 在清单文件中添加休眠唤醒和解锁权限

1
2
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

第二步 在需要弹出显示的Activity的onCreate方法中添加相应flag代码

1
2
3
4
5
6
7
8
9
10
11
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED //锁屏显示
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD //解锁
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON //保持屏幕不息屏
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);//点亮屏幕

setContentView(R.layout.activity_main);

}

第三步 触发Activity启动

比如推送触发 后台Service触发 或者IM长连接信令触发等等

1
2
3
4
private void openActivity(Context context, String msg) {
Intent intent = new Intent(context, MainActivity.class)ialarmIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
context.startActivity(intent);
}

完毕

本文为作者原创转载时请注明出处 谢谢

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

关于Github加速方法总结

发表于 2022-07-07

前言

最近网站大部分图片访问变慢, 原因出在jsdelivr加速失效, 为此我更换了CDN域名, 顺带总结一下github加速小技巧

GitHub访问加速

1. 使用镜像访问

这相当于是克隆版的 GitHub , 网站的内容和 GitHub 是完整同步, 可以在这个网站里面进行下载克隆等操作, 镜像地址如下:

  • https://hub.fastgit.org

使用示范:

1
2
3
4
5
https://github.com/typecho/typecho

可以改成

https://hub.fastgit.xyz/typecho/typecho

2.修改Host文件加速

首先需要获取对应域名实际ip地址, 可以通过以下网站查询:

  • https://www.itdog.cn/

  • https://www.ipaddress.com/

image-20220707154831063

需要查询的地址有:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 基本地址
'github.com',
'gist.github.com',
'assets-cdn.github.com',
'raw.githubusercontent.com',
'gist.githubusercontent.com',
'cloud.githubusercontent.com',
'camo.githubusercontent.com',
'avatars0.githubusercontent.com',
'avatars1.githubusercontent.com',
'avatars2.githubusercontent.com',
'avatars3.githubusercontent.com',
'avatars4.githubusercontent.com',
'avatars5.githubusercontent.com',
'avatars6.githubusercontent.com',
'avatars7.githubusercontent.com',
'avatars8.githubusercontent.com',
'avatars.githubusercontent.com',
'github.githubassets.com',
'user-images.githubusercontent.com',
'codeload.github.com',
'favicons.githubusercontent.com',
'api.github.com'

一个一个查询太过麻烦, 可以使用python脚本快速批量获取, 代码如下:

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
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python
# coding:utf-8

import socket

def output_hosts():
domains = ['github.com',
'gist.github.com',
'assets-cdn.github.com',
'raw.githubusercontent.com',
'gist.githubusercontent.com',
'cloud.githubusercontent.com',
'camo.githubusercontent.com',
'avatars0.githubusercontent.com',
'avatars1.githubusercontent.com',
'avatars2.githubusercontent.com',
'avatars3.githubusercontent.com',
'avatars4.githubusercontent.com',
'avatars5.githubusercontent.com',
'avatars6.githubusercontent.com',
'avatars7.githubusercontent.com',
'avatars8.githubusercontent.com',
'avatars.githubusercontent.com',
'github.githubassets.com',
'user-images.githubusercontent.com',
'codeload.github.com',
'favicons.githubusercontent.com',
'api.github.com'
]

with open('hosts.txt', 'w') as f:
f.write('```\n')
f.write('# GitHub Start \n')
for domain in domains:
print('Querying ip for domain %s'%domain)
ip = socket.gethostbyname(domain)
print(ip)
f.write('%s %s\n'%(ip, domain))
f.write('# GitHub End \n')
f.write('```\n')



if __name__ == '__main__':
output_hosts()

执行脚本后, 得到如下结果:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# GitHub Start 
140.82.121.3 github.com
140.82.121.3 gist.github.com
185.199.110.153 assets-cdn.github.com
185.199.108.133 raw.githubusercontent.com
185.199.111.133 gist.githubusercontent.com
185.199.110.133 cloud.githubusercontent.com
185.199.111.133 camo.githubusercontent.com
185.199.111.133 avatars0.githubusercontent.com
185.199.110.133 avatars1.githubusercontent.com
185.199.111.133 avatars2.githubusercontent.com
185.199.109.133 avatars3.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
185.199.111.133 avatars5.githubusercontent.com
185.199.109.133 avatars6.githubusercontent.com
185.199.109.133 avatars7.githubusercontent.com
185.199.110.133 avatars8.githubusercontent.com
185.199.108.133 avatars.githubusercontent.com
185.199.111.154 github.githubassets.com
185.199.109.133 user-images.githubusercontent.com
140.82.112.9 codeload.github.com
185.199.110.133 favicons.githubusercontent.com
192.30.255.116 api.github.com
# GitHub End

将以上内容拷贝到系统Host文件中即可, 不同操作系统host文件所在路径不一样:

  1. Windows系统:修改C:\Windows\System32\drivers\etc\hosts文件
1
2
# 网络刷新
ipconfig /flushdns
  1. Linux系统:修改C:\Windows\System32\drivers\etc\hosts文件

    1
    2
    # 网络刷新
    systemctl restart network

仓库Clone下载加速

1. 将仓库克隆到Gitee

image-20220707151023271

2.使用Fast-GitHub浏览器插件

Fast-GitHub

image-20220707151433012

3.第三方网站解析加速

Toolwa

image-20220707151746721

gh-proxy

image-20220707152513916

Ghproxy

image-20220707155957192

image-20220707160024075

Raw资源加速

1. 使用fastgit

将raw.githubusercontent.com替换成raw.staticdn.net或者raw.gitmirror.com

使用示例

实际上fastgit功能很丰富, 几乎囊括了github所有. 具体如下表:

反代列表

站源 地址 缓存
github.com hub.fastgit.xyz 无
raw.githubusercontent.com raw.staticdn.net 无
github.githubassets.com assets.fastgit.org 无
customer-stories-feed.github.com customer-stories-feed.fastgit.org 480 分钟
Github Download download.fastgit.org 480 分钟
GitHub Archive archive.fastgit.org 无

fastgit官网

2.使用ghproxy

在https://raw.githubusercontent.com地址前面添加https://ghproxy.com/

比如:

1
https://ghproxy.com/https://raw.githubusercontent.com/stilleshan/ServerStatus/master/Dockerfile

本文为作者原创转载时请注明出处 谢谢

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

Hexo NexT 主题渲染 Mermaid 绘图

发表于 2022-07-05

前言

由于我的Hexo博客中的Next主题是旧版, 并不支持mermaid, 因此需要手动配置, 步骤如下

配置步骤

第一步 安装 mermaid 插件

在博客的根目录下,执行以下命令安装 hexo-filter-mermaid-diagrams 插件

1
$ npm install hexo-filter-mermaid-diagrams --save

第二步 NexT 启用 Mermaid

打开 NexT 主题的 _config.yml 配置文件,添加以下代码:

1
2
3
4
5
# Mermaid tag
mermaid:
enable: true
# Available themes: default | dark | forest | neutral
theme: default

第三步 添加script脚本

打开next/layout/_partials/footer.swig文件, 添加以下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% if theme.mermaid.enable %}
<script type="text/javascript" src='https://unpkg.com/mermaid@9.0.0/dist/mermaid.min.js'></script>
<script>
if (window.mermaid) {
var mermaid_config = {
startOnLoad: true,
theme: '{{theme.mermaid.theme}}',
flowchart:{
useMaxWidth: false,
htmlLabels: true
}
}
mermaid.initialize(mermaid_config);
}
</script>
{% endif %}

至此 配置完毕


js本地引用

如果你打算将js文件存放在本地, 可以将js文件放置到next/source/js/src目录下, 那么script脚本改成如下即可:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% if theme.mermaid.enable %}
<script type="text/javascript" async src='js/src/mermaid.min.js'></script>
<script>
if (window.mermaid) {
var mermaid_config = {
startOnLoad: true,
theme: '{{theme.mermaid.theme}}',
flowchart:{
useMaxWidth: false,
htmlLabels: true
}
}
mermaid.initialize(mermaid_config);
}
</script>
{% endif %}

本文为作者原创转载时请注明出处 谢谢

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

关于Markdown图表绘制

发表于 2022-07-03

前言

写作时难免会有图表绘制需求 比如下面几种

示例

第一种样式时序图

1
2
3
4

Alice -> Bob:Hello Bob, How are you?
Note right of Bob: Bob thinks
Bob -> Alice: I am good thanks!

第二种样式时序图

 sequenceDiagram
    participant Alice
    participant Bob
    Alice->John: Hello John, how are you?
    loop Healthcheck
            John->John: Fight against hypochondria
    end
    Note right of John: Rational thoughts 
prevail... John-->Alice: Great! John->Bob: How about you? Bob-->John: Jolly good!

甘特图

  gantt
    dateFormat  YYYY-MM-DD
    title Adding GANTT diagram functionality to mermaid
    section A section
    Completed task            :done,    des1, 2014-01-06,2014-01-08
    Active task               :active,  des2, 2014-01-09, 3d
    Future task               :         des3, after des2, 5d
    Future task2               :         des4, after des3,6d

上下流程图

graph TD;
            A-->B;
            A-->C;
            B-->D;
            C-->D;

左右流程图

graph LR;

律动乐器-->律动+氛围乐器-->律动+鼓组贝斯-->律动+鼓组贝斯+氛围乐器;
铺底+氛围-->铺底+氛围+律动-->铺底+氛围+律动+鼓组贝斯-->追加间奏乐器;

自定义style的流程图

graph LR;
    id1(Start)-->id2(Stop)
    style id1 fill:#f9f,stroke:#333,stroke-width:4px
    style id2 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5

各种形状的流程图

graph  TD;
    A[/Christmas\]--> B[\This is the text in the box\]-->
     C[\Go shopping/]-->D[/This is the text in the box/]-->E{{This is the text in the box}}-->F{This is the text in the box}-->G>This is the text in the box]-->H((This is the text in the circle))-->J(This is the text in the box)

语法实现

时序图demo代码:

1
2
3
4
5
6
7
8
9
10
11
12
    <pre class="mermaid">    sequenceDiagram
participant Alice
participant Bob
Alice->John: Hello John, how are you?
loop Healthcheck
John->John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail...
John-->Alice: Great!
John->Bob: How about you?
Bob-->John: Jolly good!</pre>
**甘特图demo代码:**
<pre class="mermaid">    gantt
dateFormat  YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
section A section
Completed task            :done,    des1, 2014-01-06,2014-01-08
Active task               :active,  des2, 2014-01-09, 3d
Future task               :         des3, after des2, 5d
Future task2               :         des4, after des3, 5d
section Critical tasks
Completed task in the critical line :crit, done, 2014-01-06,24h
Implement parser and jison          :crit, done, after des1, 2d
Create tests for parser             :crit, active, 3d
Future task in critical line        :crit, 5d
Create tests for renderer           :2d
Add to mermaid                      :1d</pre>

流程图demo代码:

    <pre class="mermaid">    graph TD;
            A-->B;
            A-->C;
            B-->D;
            C-->D;</pre>

## 总结

以上只是列举其中几种 , 除此之外还可以绘制饼状图 状态图 类图 需求图等等

更多技巧可以参考`mermaid`文档: 《[mermaid官方文档](https://mermaid-js.github.io/mermaid/#/flowchart)》





**本文为作者原创转载时请注明出处 谢谢**

![](https://gitee.com/songjianzaina/SavePicGoPic/raw/master/img/20191119095516.png)

*[乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站](https://code.newban.cn/)*

关于Git查看提交修改的文件列表

发表于 2022-06-28

1.查看最后一次提交记录的修改文件信息

1
git show --raw

2.查看指定commit id对应修改文件列表

1
git show --raw commit_id
1
git show --raw 2f80f1c8bb2cb8e91d22ad38480b681c194f6518

3.查看所有提交记录的修改文件信息

1
git log --stat
1
git log --name-only

4.查看所有修改相关的commit ID和comment信息

1
git log --pretty=oneline

5.查询指定author的修改信息

1
git log --author=jack.li

6.查看指定author在指定时间修改信息

1
2
3
4
5
6
7
8
$ git log --pretty="%h - %s" --author='Junio C Hamano' --since="2008-10-01" \
--before="2008-11-01" --no-merges -- t/
5610e3b - Fix testcase failure when extended attributes are in use
acd3b9e - Enhance hold_lock_file_for_{update,append}() API
f563754 - demonstrate breakage of detached checkout with symbolic link HEAD
d1a43f2 - reset --hard/read-tree --reset -u: remove unmerged new paths
51a94af - Fix "checkout --track -b newbranch" on detached HEAD
b0ad11e - pull: allow "git pull origin $something:$current_branch" into an unborn branch

本文为作者原创转载时请注明出处 谢谢

乱码三千 – 点滴积累 ,欢迎来到乱码三千技术博客站

1…161718…51

乱码三千

android程序员一枚,擅长java,kotlin,python,金融投资,欢迎交流~

507 日志
145 标签
RSS
© 2026 乱码三千
本站总访问量次
由 Hexo 强力驱动
|
主题 — NexT.Muse v5.1.4
0%