I'm pretty new to git (so excuse my lack of branches and other bad practices), but I've been having a problem that I can't seem to fix. How can I move the commit BT228 Challenge - Turret Rotation pt1 (v1)
to be my latest commit? In other words, so that it appears on top?
Here are some things that I've already tried:
I use git rebase -i HEAD~3
to get to this
The commit BT Using Clamp() to Limit Values - AimingComponent not showing up in Tank_BP
(4f861ad) is my latest commit (excluding the merge). So I reorder the commits like this:
Following the guidance from this website.
This happens:Which I don’t think this is what I want, but I could very well be wrong. This is the first time that I rebase so I'm not really sure what's supposed to happen...
I’ve also tried making an empty commit and then reordering, so that I don’t copy the commit BT Using Clamp() to Limit Values - AimingComponent not showing up in Tank_BP
over and over again.But this happens:
Create an empty commit using$ git commit --allow-empty -m "Placeholder commit"
, which does this:
Then I do another interactive rebase (like above):
But then this happens
One reason I was thinking this is acting strangely is that you usually rebase from one branch onto your master branch. So I’ve also tried putting my BT228 Challange...
commit onto a feature/TurretRotation
branch and then rebasing, but in that case the commit doesn’t even show up.
New branch
Rebasing using git rebase master
(no need for interactive stuff this time)
But that only moves the branch and not the commit:
EDIT:
The solution I found was jumping off of Test #1 and then using these commands.
Then I forced pushed:
git push origin master --force
And this was the result: