Skip to content

Instantly share code, notes, and snippets.

@4383

4383/git.sh

Last active Jun 16, 2020
Embed
What would you like to do?
git edit first commit
# rebase from the first commit included
git rebase -i --root
# generate a tiny changelog
git log --no-merges <tag or commit-id>.. --oneline
# search if a branch contains a specific commit
git branch --contains <commit-id>
##################
# retrieve some history
# on specific file
git rev-list --all -- "*reproducer.rst"
git log --name-only --oneline --all -- "*reproducer.rst"
# display date and authors
git log --oneline --no-merges --pretty=format:"%h%x09%an%x09%ad%x09%s" v2.1.4..v4.2.0
# Which commit (sha only) deleted a file
git log --format=%H --all --diff-filter=D -- puppet/services/docker.yaml
# List since a file was deleted (since openstack branch)
git branch -r --contains $(git log --format=%H --all --diff-filter=D -- puppet/services/docker.yaml) | grep -v master | sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.