Created
September 15, 2023 12:57
-
-
Save christophemarois/0d0b8128695a20b8112488a73854911c to your computer and use it in GitHub Desktop.
List branch changes in git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list changed files in a branch compared to its base branch | |
# usage: git_list_branch_changes [base_branch?] | xargs echo | |
function git_list_branch_changes { | |
local BASE_BRANCH="${1:-main}" | |
(git diff --diff-filter=MA --name-only $BASE_BRANCH... && git status --short --porcelain | awk '{print $2}') | sort -u | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment