Skip to content
JessicaOPRD edited this page May 17, 2023 · 3 revisions

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?

With command line log

git log --since="2021-09-27" --name-only --pretty=format: | sort | uniq

With GitHub

  1. 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.
  2. Copy the from and to commit IDs/SHAs. You can use the copy icon to do so.
  3. 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?
  4. Paste the from and to commit IDs/SHAs to the end of the URL, with ... between them: https://github.com/[repo path]/[from]...[to]
  5. Click the "Files changed" tab
  6. 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).

Testing what this does?

Clone this wiki locally