Skip to content

Instantly share code, notes, and snippets.

View jraleman's full-sized avatar
🏠
Working from home

Jose Ramon Aleman jraleman

🏠
Working from home
View GitHub Profile
@jraleman
jraleman / git-change-commit-messages.md
Created August 12, 2019 20:07 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@jraleman
jraleman / repo-reset.md
Created September 27, 2018 04:31 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A