Get the SHA of the last commit on a remote branch:
git ls-remote [email protected]:org/repo.git branch_name | awk -F '\t' '{ print $1 }'
Delete remote branch
git push -d <remote_name> <branchname>
Get a diff between the remote repo of a subtree and the subtree directory of a dependent project:
git diff -w -G upstream-subtree-repo/main main:subtree-repo-directory
Or to see a specific file at a specific commit (where ad893d21
is a commit in the upstream subtree repo):
git diff -w --compact-summary ad893d21:.github/CODEOWNERS main:subtree-repo-directory/.github/CODEOWNERS