Last week, I shared several ways to edit the author or email of a commit in different scenarios. Today, I'll show a more advanced technique using git interactive rebase! Interactive rebase can be used for many other actions as well, not JUST fixing the author and email. It is worth mentioning that git interactive rebase is a very powerful tool and is essentially used to rewrite your git history. Before you do any kind of rebasing, make sure you aren't impacting a shared/highly collaborative branch (unless your team knows what's happening and is ok with the rebase) and possibly practice a few times on test branches until you are comfortable with the workflow of rebasing!
Interactive rebase is kind of like a rewind and replay workflow. You start with the last "good" commit you know (rewind), and then re-apply the commits one-by-one (replay), making any changes that you missed the first time around or are otherwise necessary.
So... let's say you need to fix the author/email for your last 4 commits. Here's how to use git interactive rebase to fix that:
git rebase -i HEAD~4 - First, we need to rewind back 4 commits. So we initiate the git rebase command with the interactive (-i) flag. Then we pass the PARENT of the last commit we want to edit. In our case that's HEAD~4. 💡Pro tip: It may be easier to remember that the ~4 means you want to edit the last 4 commits, but it's worth noting that you're actually specifying 5 commits ago. Just an FYI 🙂)
Once you run this command, you'll enter text editor mode with lots of options. At the top, you'll see the last 4 commits (commit hash and commit message) you've designated in chronological order. You'll also notice that each commit has the word "pick" before them. These are the commands that will be executed for each commit. If you read the description, you'll see that the "pick" command essentially means "use this commit as-is, make no changes". Since, however, we do want to change something for each commit (the author and email) we should change the "pick" commands to the "edit" commands. (Continued in comments!)...
Nothing quite like a great cup of @sunergos_coffee to get lots of work done! #coffeeandcoding
What all did you fit into this day?
Dang. I can't believe its already been 5 months since I've started my 2nd job as a #developer . Thats almost half a year dudes haha.
My life has changed so much since I've made that next step into my career.
I'm learning a multitude of things about the web so along with design patterns, the importance of attention to detail, how HTML and CSS is super underrated, and more than anything the importance of building trust within your team.
I'm still very new to this company, but one thing I do know is that I have given my 110% to this company.
Other than the huge pay raise I received after joining @entrepreneur, I feel like I'm finally on that path where I honestly dont have to worry anymore.
It's insane feeling knowing that your future is super financially secured.
Anyone who starts learning code today can seriously see their life changed in a matter of 6-12 months.
Tired of living paycheck to paycheck? Learn code today and triple your income by December 2020. It is very very possible. It just depends if you are willing to put in the hard work and humble yourself every single day as you aim to get there. #devsLife
No one said it would be easy
Coding time⏳:35 min
Well im back after three million years. Who said a M.Sc. degree would be a walk in the park? Yeah just finished an assignment which is due on Monday but couldn’t stop glancing at one of @dhanishgajjar Stories promoting @wesbos courses. I only saw the video today in one of my breaks and was completely hooked! Just wanted to get home and work on that thing.
Tomorrow I will go to work, clean up some the documentation I was working on and prepare some things for the new year. I’m getting someone to work with me and I have to teach that person a few things that I have learned there...so why not make a few conventions out of it right?
Rapidminer is awesome, the Problem...my data, we decided to not fixate on the available columns that exist but to create our own relevant data out of the data we have...makes sense? We will discuss this over our next skype meeting and hopefully get more things done!
For the last hours or minutes of this day I want to finish up the @wesbos course make some notes and create my own version of it. Besides that I’m just happy it’s the weekend already and I’m looking forward to this one since my gf is coming! Have a great evening everyone!....whoever is reading 🐋
Keep on coding!
Coming back to my PHP & jQuery Todo app after taking a break from it for a few weeks. Although, all that really needs to be done is styling and small adjustments since I started on the backend functionality first. How is everyone’s week going?
ACID in terms of databases
💡 ACID is an acronym which stands for Atomicity, Consistency, Isolation, Durability was coined in 1983 as result of establishing terminology for ✴fault-tolerance mechanism✴ in database. These four properties describe the major guarantees of the transaction paradigm.
✴ Fault-tolerant mechanism is the mechanism that allows an application to continue working properly if a failure was occurred in some of its components. If its operating quality decreases at all even a small failure can cause total breakdown
#TBT What Track girls do when they run out of balls at the driving range
Hitch up your shirt and lay on the grass = photo shoot 📸 @conradwilliams400m
#selfawareness#tbt#golf#photoshoot @montytrackstar @itspsd @vicbarr_
Morning kick start thought 2: A genuine apology has three parts:
1. What I did was wrong.
2. I am sorry that I hurt you.
3. How do I make it better?
—Professor Randy Pausch
Morning kick start thought: Career advice:
1 You are not your job
2 I can > IQ
3 Measure outcomes
4 There is no career ladder
5 Lift others and you become the ladder
6 You do not need a title to lead
7 Meet deadlines
8 Deliver outside a job description
9 Stay teachable
10 Share the credit
Understand that no one is obligated to be nice to you, so when a person extends a kind word, a complement, a greeting , a smile never take that for granted
Gratitude is absolutely free