My git commands

1.

git commit --amend --date=now --no-edit

to change the date of the last (local) commit. –no-edit for not modifying the commit message, otherwise it will open a text editor to enter new commit message.

git commit --amend --no-edit --date="2020.11.02 12:00:04"

2.

git commit --amend -m '#572: Fixed crash'

to change the message of the last (local) commit.

3.

git merge feature/CoolFeature --no-ff

merge branch ‘feature/CoolFeature’ without fast-forwarding current branch

4.

git merge feature/CoolFeature --squash -m '#573: CoolFeature'

will combine all the commits of ‘feature/CoolFeature’ into one single commit and merge that commit to current branch.

Leave a Reply

Your email address will not be published. Required fields are marked *