Skip to content

Files

Latest commit

 

History

History
30 lines (25 loc) · 1.81 KB

git.md

File metadata and controls

30 lines (25 loc) · 1.81 KB

Git

What is the difference between merge and rebase?

  • Both commits D and E are still here, but we create merge commit M that inherits changes from both D and E. However, this creates diamond shape, which many people find very confusing.
  • We create commit R, which actual file content is identical to that of merge commit M above. But, we get rid of commit E, like it never existed (denoted by dots - vanishing line). Because of this obliteration, E should be local to developer Ed and should have never been pushed to any other repository.
Relative links:

What is git reset?

git-reset - Reset current HEAD to the specified state

Relative links:

What is the difference between soft reset and hard reset?

  • soft: uncommit changes, changes are left staged (index).
  • mixed (default): uncommit + unstage changes, changes are left in working tree.
  • hard: uncommit + unstage + delete changes, nothing left.
Relative links:

How to combine multiple commits into one prior to push?

Relative links:

Home Page