Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,360
Community Members
 
Community Events
176
Community Groups

[SOLVED] Reordering a past commit to be my latest one?

Edited

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?

progress2.PNG

 

Here are some things that I've already tried:

Test #1

  1. I use git rebase -i HEAD~3 to get to this
  2. rebasei
  3. 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:
  4. Following the guidance from this website.reorder
  5. This happens:thishappensbetterWhich 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...

Test #2

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:

  1. Create an empty commit using $ git commit --allow-empty -m "Placeholder commit", which does this:placeholder
  2. Then I do another interactive rebase (like above):secondrebase
  3. But then this happensnothinghappens

Test #3

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.

  1. New branchnewbranch
  2. Rebasing using git rebase master (no need for interactive stuff this time)
  3. But that only moves the branch and not the commit:movingonlybranch

 


EDIT:

The solution I found was jumping off of Test #1 and then using these commands.

followinstructions2.PNG

Then I forced pushed:

git push origin master --force

And this was the result:

nowwhat.PNG

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events