If you want to know the list of all files that were added/modified/updated or deleted for each commit in a branch, you can make use of the git log command with --name-status flag.
Example:# git log --name-status
commit 0919b37fc90ab264f5759cd9966ef6838153f673 (HEAD -> main)
Author: Git User <email@example.com>
Date: Thu Mar 14 12:00:00 2024 +0100
Updated script2.py and script3.py, deleted script4.py
M script1.py
M script3.py
D script4.py
commit 898fd171aaf7c60a108af0478cf04643d253e541
Author: Git User <email@example.com>
Date: Wed Mar 13 12:00:00 2024 +0100
Modified script2.py
M script2.py
commit c57cdeff4640ee0c62d5f6c796282e722b39a26b
Author: Git User <email@example.com>
Date: Tue Mar 12 12:00:00 2024 +0100
Added script1.py and script2.py, modified script3.py
A script1.py
A script2.py
M script3.py
As you may see in the above example, we have 3 commits details shown using the git log command with names and details of files that were committed in each step.
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to Git,
- Change the default git branch name from master to main
- [Fixed] Git Clone git@github.com: Permission denied (publickey) Could not read from remote repository Fatal error
- [Solution] fatal: not a git repository (or any of the parent directories): .git
- [fix] zsh: command not found: git
- How to Install Git on Windows
- Setup Git + Visual Studio Code Tutorial
- How to undo last Git Commit on Local Repository?
- Install GitHub Command Line Tool on Mac
- How to Create a Git Branch in 6 Different ways
- Fix Git: Warning: could not find UI helper GitHub.UI on Windows
- Git Config Command - A Deep Dive
- Step-by-Step: How to delete a git branch from local as well as remote origin
- How to Add Git Bash Option to Windows Terminal List
- Command to Clone Repository Using Git Bash
- How to remove or unstage a file from git staged area
- Get the file location of git config values
- GitHub: How to Search Code
- How to check your installed version of Git
- Fix: error: src refspec master does not match any failed to push some refs to Git
- Git: Step-by-Step - How to Push Local Brach to GitHub
- How to Merge Branch into Master Branch
- fix fatal: --local can only be used inside a git repository error
- Fix: Git Pull Error: unable to resolve reference refs/remotes/origin/master: reference broken
- Change the default diff or commit editor for git
- Git Fix: fatal: refusing to merge unrelated histories Error
More Posts:
- Ubuntu Linux: How to Login as root User - Ubuntu
- How to initiate a photo request on iPhone from Mac Monterey - iOS
- How to switch between sftp and Terminal shell - FTP
- How to Install npm using Mac Terminal - MacOS
- Notepad++ Ghost typing Examples - NotepadPlusPlus
- How to take screenshot on Android - Android
- How to write JSON file in Python Program - Python
- How to Open VS Code on Mac - MacOS