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
.
Boysober
Have you ever wondered what life might be like if you stopped worrying about being wanted, and focused on understanding what you actually want? That was the question Hope Woodard asked herself after a string of situationships inspired her to take a break from sex and dating. She went "boysober," a personal concept that sparked a global movement among women looking to prioritize themselves over men. Now, Hope is looking to expand the ways we explore our relationship to relationships. Taking a bold, unfiltered look into modern love, romance, and self-discovery, Boysober will dive into messy stories about dating, sex, love, friendship, and breaking generational patterns—all with humor, vulnerability, and a fresh perspective.
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