git push -f origin 'refs/remotes/old/*:refs/heads/*'
Between current master
and previous master
git log --no-merges --format="%s" master^..master
Between the latest and second to last tag
git log --no-merges --format="%s" $(git tag | sort -Vr | head -2 | tail -1)..$(git tag | sort -Vr | head -1)
Useful to check your changes before commiting them.
git ls-files -mo --exclude-standard '*.py' | xargs -r flake8
git diff --name-only HEAD $(git merge-base origin/master HEAD) | grep '\.py$' | xargs -r flake8
git worktree add ../config -b conf
Create a worktree and a branch as usual.
git worktree add ../config -b conf
Go to the directory.
cd ../config
Reset the state of the branch to the very first commit.
git reset --hard $(git rev-list --max-parents=0 HEAD)
Remove old files and add new ones.
Rewrite the only comment in the branch.
git add --all
git commit --amend -m 'Add nginx config'
git log --pretty="%ae" --no-merges | sort | uniq -c | sort -nr -k 1