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.
reset
is likely one of the commands that people shy away from using because it can mess with your working tree as well as what commit HEAD
references.reset
is a reference editor, an index editor and a working tree editor.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. |
git reset
mode flags change?--mixed
is the default mode.reset --mixed
of more than one commit, all of those changes will be put back in the working tree together essentially setting you up for a squash of those commits.git reset --soft HEAD^
git update-ref HEAD HEAD^
git status
after either of the previous commands, you’d see more changes because your working tree is now being compared to a different commit, assuming you previously had changes in your working tree. git commit --amend
.--mixed
for multiple commits, if you do a reset --soft
of more than one commit, all of those changes will be put back in the index together essentially setting you up for a squash of those commits.git reset --hard HEAD
will get rid of any changes in your index and working tree to all tracked files, such that all of your files will match the contents of HEAD
.
Are You A Charlotte?
In 1997, actress Kristin Davis’ life was forever changed when she took on the role of Charlotte York in Sex and the City. As we watched Carrie, Samantha, Miranda and Charlotte navigate relationships in NYC, the show helped push once unacceptable conversation topics out of the shadows and altered the narrative around women and sex. We all saw ourselves in them as they searched for fulfillment in life, sex and friendships. Now, Kristin Davis wants to connect with you, the fans, and share untold stories and all the behind the scenes. Together, with Kristin and special guests, what will begin with Sex and the City will evolve into talks about themes that are still so relevant today. "Are you a Charlotte?" is much more than just rewatching this beloved show, it brings the past and the present together as we talk with heart, humor and of course some optimism.
On Purpose with Jay Shetty
I’m Jay Shetty host of On Purpose the worlds #1 Mental Health podcast and I’m so grateful you found us. I started this podcast 5 years ago to invite you into conversations and workshops that are designed to help make you happier, healthier and more healed. I believe that when you (yes you) feel seen, heard and understood you’re able to deal with relationship struggles, work challenges and life’s ups and downs with more ease and grace. I interview experts, celebrities, thought leaders and athletes so that we can grow our mindset, build better habits and uncover a side of them we’ve never seen before. New episodes every Monday and Friday. Your support means the world to me and I don’t take it for granted — click the follow button and leave a review to help us spread the love with On Purpose. I can’t wait for you to listen to your first or 500th episode!
Dateline NBC
Current and classic episodes, featuring compelling true-crime mysteries, powerful documentaries and in-depth investigations. Follow now to get the latest episodes of Dateline NBC completely free, or subscribe to Dateline Premium for ad-free listening and exclusive bonus content: DatelinePremium.com