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
-
git switch development
git pull
git switch -c revert-changes
git revert <commitId> (or range with <commitIdBegin>..<commitIdEnd>
git push -
@stop i think a range was always possible, though you have to provide the range in the right order.
I could be wrong, as it's muscle memory, though I'm pretty sure it's possible. -
When you learn git, you will realize it's often hard to f-up (lose changes). Maybe go through https://learngitbranching.js.org
I would create a new branch on the tip of your feature branch, drop unnecessary commits first, and then rebase it on the latest master.
It's similar to the IntrusionCM's approach, but you will be able to solve conflicts more gradually. -
1. Switch to a new branch on the tip of your old branch:
"git switch -c <new-branch> <old-branch>"
2. Rebase new branch to the branching point of your old branch and drop commits you don't need:
"git rebase -i <old-branch-start>"
3. Rebase to latest master:
"git rebase <master>"
Related Rants
I need some help. I have a 1 months old MR in gitlab with 5 commits of a feature that I have to revert.
I have hard time understanding how to solve git revert conflicts and frankly this three windows GUI on intellij idea is very confusing to me. I am like afraid that I will accept a bad change or miss something.
Is there any other way to make this merge conflict solving easier? I was thinking maybe I could just rebase to head where I added my commits, revert them without conflicts and then rebase that branch on latest develop?
In that case I would be solving merge conflict by adding stuff instead of removing old stuff and being afraid that I will mess up something. Goal is to create a revert feature MR.
rant
question