>
> commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, 
> origin/copy) 
> | Author: Uwe Brauer <o...@mat.ucm.es> 
> | Date: Thu Nov 25 10:43:56 2021 +0100 
> | 
> | Add patches to my new branch 
> | 
> | --HG-- 
> | branch : copyright 
> | 
> * commit 66380013003549a6851d4e110b29a5a439e05609 
> | Author: Uwe Brauer <o...@mat.ucm.es> 
> | Date: Mon Nov 22 21:51:13 2021 +0100 
> | 
> | Add patches to a special, named branch! 
> | 
> | --HG-- 
> | branch : copyright 
> | 
> * commit c945bf50251150e0d4ad7ee751c7e9615cb4b3e8 (origin/master, 
> origin/HEAD) 
> | Author: Uwe Brauer <o...@mat.ucm.es> 
> | Date: Mon Nov 22 09:33:48 2021 +0100 
> | 
> | Correct a silly typo in company-matlab-shell.el 
> | 
> | * company-matlab-shell.el: 677 correct a silly typo: Auctex should be 
> Matlab 
>
>
> The first two commits I should have pushed.


This is confusing, do you mean the top two ? or the bottom two ?

I will discuss both possibilities and explain how I would do it the easy 
way.

With easy I mean easy to remember and execute.

Situation Top Two, both copyright statements:

git checkout <commit hash of safe point>
git branch newbase

git checkout <commit hash of keep point>
git branch moveme

git checkout <commit hash of split point>
git branch splitpoint

(splitpoint could be same as newbase)

git switch moveme
git rebase --onto newbase splitpoint moveme

that will skip over the bad commit and keep that one on a seperate branch
git checkout <bad commit hash>
git branch badcommit
git branch -d badcommit

that should get rid of it.

git branch -m renametofinalbranchname

git push origin -f finalbranchname

overwrites/force pushes it to server

Situation bottom two:

easy 
git checkout <hash of bad/top commit>
git branch badcommit
git branch -d badcommit
git checkout <hash of good commit>
git branch finalbranchname
or
git switch finalbranchname
git push origin -f finalbranchname

This is where GIT could use lots of work to make things easier:

git delete <bad commit hash>

Should handle all of this automatically :)

Bye for now,
  Skybuck.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/dc3f4342-93f5-458a-9c0a-6e8abbda10a9n%40googlegroups.com.

Reply via email to