Skip to content

Latest commit

 

History

History

commit

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Git Commit

Guidelines

Tools

Semantic Commit Messages

chore: add Oyster build script
docs: explain hat wobble
feat: add beta sequence
fix: remove broken confirmation message
ref: share logic between 4d3d3d3 and flarhgunnstow
style: convert tabs to spaces
test: ensure Tayne retains clothing

Usage

git commit -am <message>

Tips

Change Commit Date for 1 hour ago

export GIT_COMMITTER_DATE="$(gdate -d 'last sunday' +'%Y-%m-%d') $(gdate +'%H:%M:%S')"
export GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE"

git commit --amend --no-edit --date="$GIT_AUTHOR_DATE"

Amend Last Commit with Same Date

git commit --amend --no-edit --date="$(git show -s --format=%ci HEAD)"

Information

#
git --no-pager show $(git rev-list --max-parents=0 HEAD)

#
git --no-pager shortlog -s -n

Change Author

git commit --amend --author 'Bruno Wego <brunowego@gmail.com>'

Change Author for Specific Commit

git log

#
git rebase -i --root

#
git rebase -ir '[hash]^'

#
git commit --amend --author='[name] <[email]>'

#
git rebase --continue

Bypass pre-commit and commit-msg hooks

#
git commit -nm '<message>'

Date

git commit --date '10 day ago' -m '<message>'
git commit --date 'Wed Feb 16 14:00 2037 +0100' -m "<message>"

git commit --amend --no-edit --date='10 day ago'

Modify Specified Commit

Modify pick to edit:

# Get hash of commit to modify
git log --oneline

git rebase -i '<hash>^'

git commit --all --amend --no-edit

git rebase --continue

Rewriting Commit Messages

# Get hash of commit to modify
git log --oneline

#
git rebase -i <hash>

Modify pick to reword:

Inject Commit Between Commits

git log --oneline

Modify pick to edit:

git rebase -i HEAD~3

git commit --all -m 'New commit'

git rebase --continue

Issues

Amend Merge

fatal: You are in the middle of a merge -- cannot amend.
git commit -a