Git - JessicaOPRD/docs GitHub Wiki
Cherry-picked merge between branches
This would not be a single cherry-picked commit, but rather cherry-picking between branch states. It's an unpleasant scenario, but it does happen in chaotic environments and projects.
The easiest way to walk back is to merge the branch, undo the commit (if using a GUI or other tools that auto-committed on a clean merge), and manually revert files you don't want included. Stage any untracked adds. Then use a simple git status
to determine which files actually changed.
List changed files across range of commits (many, not two)
For some reason I struggled to figure this out. Is this one reason people sometimes choose to rebase?
log
With command line git log --since="2021-09-27" --name-only --pretty=format: | sort | uniq
With GitHub
- Navigate to your project’s commits log. I usually click the "# commits" link at the top of the repository with the latest commit info. This opens the full log of commits for the repository.
- Copy the from and to commit IDs/SHAs. You can use the copy icon to do so.
- Append "compare" to the end of your repository URL (
https://github.com/[repo path]/compare/
) – I couldn't find a way to access this via the interface? - Paste the from and to commit IDs/SHAs to the end of the URL, with
...
between them:https://github.com/[repo path]/[from]...[to]
- Click the "Files changed" tab
- Click the "# changed files" link near the top of the diff to see just a list of impacted files
More information: https://docs.github.com/en/free-pro-team@latest/github/committing-changes-to-your-project/comparing-commits
List uncommitted files
git diff --name-only
This seems to skip "untracked" files (new files).