Difference between revisions of "Git"

From John Freier
Jump to: navigation, search
(Created page with " == Rebase == When you are on a branch, you get git rebase master == Squash feature branch == This squashes all the commits in to one. git merge --squash feature and...")
 
Line 11: Line 11:
 
and then you need to commit the new squashed changes.
 
and then you need to commit the new squashed changes.
 
   get commit -m "squashed changes merged in."
 
   get commit -m "squashed changes merged in."
 +
 +
== Squash Commits ==
 +
This squashes the last 3 commits.
 +
  git reset --soft HEAD~3
 +
  git commit -m 'new commit message'

Revision as of 15:47, 6 May 2020

Rebase

When you are on a branch, you get

 git rebase master 


Squash feature branch

This squashes all the commits in to one.

 git merge --squash feature 

and then you need to commit the new squashed changes.

 get commit -m "squashed changes merged in."

Squash Commits

This squashes the last 3 commits.

 git reset --soft HEAD~3
 git commit -m 'new commit message'