Git - clicking on the highest maximum on the server

I have a situation where I:

(1) Merging the patch by user X
(2) Some changes were made to some other code and fixed.

Now I want to forward my message to the server. However when i do

git push origin HEAD:refs/for/mybranch

I get an error regarding a patch that I combined, stating that I am not the author. Is there a way to do what I'm trying to accomplish? If not, is there a way to keep the commit and then revert everything and direct my latch back?

+1
source share
3 answers

Second revision:

git reset --soft HEAD^ (to undo your commit)
git stash (to stash away your changes)
git reset --soft HEAD^ (to undo the merge commit from X)
git stash (stash away X)
git stash apply stash@{1} (apply your changes)
git add . (add and commit and push ..)
git commit -m "some changes"
git push
git stash apply stash@{0}

Revised answer:

So, you need to reset take another step back in history:

git reset --soft HEAD^ (to undo your commit)
git stash (to stash away your changes)
git reset --hard HEAD^ (to undo the merge commit from X)
git stash apply (apply your changes)
git add . (add and commit and push ..)
git commit -m "some changes"
git push
git merge featureX (re merge the changes from X)

Original answer:

You can reset your head so that your commit is moved to the index:

git reset --soft HEAD^

git , . :

git stash save "stashing commit for changes from X"

X , :

git push
git stash apply
git add .
git commit -m "some stuff"
+1

, " - " ? Git , , " X" .

, , :

git push origin HEAD:refs/for/mybranch

git push origin mybranch
0

, repo , - , /.

You can try cherry picking so that the committer is tuned for you. If this does not work, you need to ask who would set the repository hook because it breaks almost all git workflows, because you can never push the merge commit.

0
source

Source: https://habr.com/ru/post/1665550/


All Articles