My digital garden
Git: Changed File Names With Certain Extension
Initializing search
    sosiristseng/sosiristseng.github.io
    sosiristseng/sosiristseng.github.io
    • My digital garden
    • Tags
      • Bookmarks
      • Document processing
      • Julia
      • Python
      • Research Bookmarks
      • Static site generators
      • Web design
      • Academic writing
      • Course notes
      • ffmpeg
      • firefox
      • Ubuntu postinstall
      • Visual Studio Code
      • Windows Postinstall
      • Windows software
      • yt-dlp
      • zotero
      • Developement
      • System
      • Portal
      • Archive
      • Categories
    Back to index
    • Metadata
      • March 17, 2024
      • in DevOps
      • 1 min read
    git

    Git: Changed File Names With Certain Extension

    For example, how to find changed PHP files between latest and the commit before it: 1

    git diff --name-only HEAD~1 HEAD '**/*.php'
    

    If the shell does not support the glob pattern, use grep

    git diff --name-only HEAD~1 HEAD | grep .php
    

    1. https://stackoverflow.com/questions/4734300/git-changed-file-names-with-certain-extension ↩

    August 28, 2025 March 17, 2024
    Next
    Github Action and Cirrus CI
    Copyright © 2016 - 2024 Wen-Wei Tseng
    Made with Material for MkDocs