Rundown: git

Automatically select commits from the current branch during a merge

git checkout "${master}"
git merge "${branch}"
git checkout --ours "${master}"

These flags can be counterintuitive in other contexts.

https://nitaym.github.io/ourstheirs/

Read the minimal size of a git repo

1git count-objects -vH | grep -Po 'size-pack: \K.*'

Git repositories are never at their minimal size.

Email a pull request which points to your git server

1repo=ssh://soft.dmz.rs:2222/mkdots/
2theirHead='HEAD^^^^'
3head=master
4git request-pull "${theirHead}" "${repo}" "${head}"

You can note where your branch diverged from theirs with a commit hash, or a relative position, like HEAD^^ (e.g. 'two commits before your latest').

Choose which parts to commit with git

1git commit -p

Use P to see big changes which cannot fit on the screen.

Clean up a bloated git repo

1git fsck --full
2git gc --prune=now --aggressive
3git repack

Show git commits as a recfile

1git log --all --pretty=tformat:"Date: %aI%nCommit: %H%nAuthor: %an%nMessage: %s%nRef: %S%nParent: %P%n"

Push the current branch to all remotes

1remotes="$(git remote show)"
2git config remotes.all "$remotes" 
3git push all

Edit a file at an uncommited change in a git repo

1git jump 

You might need to copy the script from /usr/share/git/git-jump/