Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Sumafu22486yUse the git reset command. I use this command very often to correct my mistakes 😅
Edit: git reset --hard <commitId>
This resets the branch pointer to the specified commit -
OP just like the first comment, rest your branch to that commit either hard or soft rest then force push to override it in the origin branch
-
OK, I think i found out where I fucked up.
I renamed a file, but not with git mv, but with normal mv, inside a new branch.
Which resulted in this fuckery once I merged it. -
rytzpekt2756yWith the assumption that you have up to date local branches dev and master
@dev git reset --hard <bad commit>^
@dev git rebase master
@dev git checkout master
@master git rebase dev
1. Remove bad commit from dev
2. Rebase correct history from master
3. Switch to master
4. Fast forward rebase master to same history as dev (this should be no-op, but to be sure)
Related Rants
Can anyone of you help me.
I couldnt find anything on the internet, on how to remove that one branching commit, or how it got there in the first place.
(that commit and the one above it, introduce exactly the same changes)
question
git