Skip to main content
Add Shell syntax highlighting
Source Link
Benjamin Loison
  • 5.5k
  • 4
  • 18
  • 37

2020 Simple solution without rebase :

git reset --soft HEAD~2 
git commit -m "new commit message"
git push -f
git reset --soft HEAD~2 
git commit -m "new commit message"
git push -f

2 means the last two commits will be squashed. You can replace it by any number

2020 Simple solution without rebase :

git reset --soft HEAD~2 
git commit -m "new commit message"
git push -f

2 means the last two commits will be squashed. You can replace it by any number

2020 Simple solution without rebase :

git reset --soft HEAD~2 
git commit -m "new commit message"
git push -f

2 means the last two commits will be squashed. You can replace it by any number

deleted 14 characters in body
Source Link
Xys
  • 9.9k
  • 3
  • 46
  • 59

2020 Simple solution without rebase :

git reset --soft HEAD~2

git commit -m "new commit message"

git push -f

git reset --soft HEAD~2 
git commit -m "new commit message"
git push -f

2 means the last two commits will be squashed. You can replace it by any number

2020 Simple solution without rebase :

git reset --soft HEAD~2

git commit -m "new commit message"

git push -f

2 means the last two commits will be squashed. You can replace it by any number

2020 Simple solution without rebase :

git reset --soft HEAD~2 
git commit -m "new commit message"
git push -f

2 means the last two commits will be squashed. You can replace it by any number

deleted 5 characters in body
Source Link
Xys
  • 9.9k
  • 3
  • 46
  • 59

2020 Simple solution without rebase :

git reset --soft HEAD~2

git commit -m "new commit message"

git push --forcef

2 means the last two commits will be squashed. You can replace it by any number

2020 Simple solution without rebase :

git reset --soft HEAD~2

git commit -m "new commit message"

git push --force

2 means the last two commits will be squashed. You can replace it by any number

2020 Simple solution without rebase :

git reset --soft HEAD~2

git commit -m "new commit message"

git push -f

2 means the last two commits will be squashed. You can replace it by any number

added 4 characters in body
Source Link
Xys
  • 9.9k
  • 3
  • 46
  • 59
Loading
Source Link
Xys
  • 9.9k
  • 3
  • 46
  • 59
Loading