Just a collection of git + magit things that I need to start remembering.
git switch -c my-branch
# ... do work
git fetch origin main
git rebase -i origin main
git push origin my-branch
gh pr create --fill
gh pr view --web
- -Spattern - Look for differences that change the number of occurrences of the specified string (i.e. addition/deletion) in a file. Intended for the scripter’s use.
- -G - Look for differences whose patch text contains added/removed lines that match
- --pickaxe-all - When -S or -G finds a change, show all changes in the changeset, not just for matches.
- -p - include diff
- --grep - search log messages for pattern, many greps = any-match, unless --all-match is specified
- -E - extended regexp
- --invert-grep
- --after
- --before
- --branches
- --tags
- --remotes
- --glob
- --oneline - commits on one line
git log -Spattern
git log -Gpattern
git log -Spattern -p # with diff
- Open the Magit log buffer with ll (lowercase L twice).
- Customize the log with L and search for commit messages with -F or for changes with -G.
- Once you entered your search value, press RET and refresh the buffer with g. You will see only commits that match your search.
https://stackoverflow.com/a/2928721/3745474
git log -Spattern
git log -Spattern -p # with git diffs