Listen

Description

We wrap up Git from the Bottom Up by John Wiegley while Joe has a convenient excuse, Allen gets thrown under the bus, and Michael somehow made it worse.

The full show notes for this episode are available at https://www.codingblocks.net/episode195.

Sponsors

News

In Conclusion, …

Git Reset

git reset Modifies HEAD? Modifies the index? Modifies the working tree?
--mixed YES YES. Removes all staged changes from the index, effectively unstaging them back to the working tree. YES. All changes from the reset commit(s) are put in the working tree. Any previous changes are merged with the reset commit(s)'s changes in the working tree.
--soft YES YES. All changes from the reset commit(s) are put in the index. Any previously staged changes are merged with the reset commit(s)'s changes in the index. NO. Any changes in the working tree are left untouched.
--hard YES YES. Clears the index of any staged changes. YES. Clears the working tree of any unstaged changes.
What do the git reset mode flags change?

Mixed reset

Soft Reset

Hard Reset

As mentioned previously, if you have other consumers of your branch/commits, you should be careful when making changes that modify history like this as it can force unexpected merges to happen to your consumers.

Stashing and the Reflog

Resources we Like

Tip of the Week