33
loading...
This website collects cookies to deliver better user experience
git commit --amend --author="<name> <email>" --no-edit
git push -f origin <branch-name>
git log
command and check in the history that the change was applied.2c6eececec35ece0dc52c683de2dbc34553b283b
1c6eececec35ece0dc52c683de2dbc34553b283b
commit 2c6eececec35ece0dc52c683de2dbc34553b283b (HEAD -> feature/test, origin/feature/test)
Author: Brayan Arrieta <wrong-email>
Date: Tue Jun 22 16:06:10 2021 -0600
Feat: change some stuff
commit 1c6eececec35ece0dc52c683de2dbc34553b283b (HEAD -> feature/test, origin/feature/test)
Author: Brayan Arrieta <wrong-email>
Date: Tue Jun 22 16:04:10 2021 -0600
Feat: change server
commit 4d133f673250ed628e58371a8b246d68171fbbf9 (origin/master, origin/HEAD, master)
Merge: 144c453125 cb1ac7e774
Author: Other User <[email protected]>
Date: Tue Jun 22 13:40:43 2021 -0500
Merge branch 'feature/test2' into 'master'
git rebase -i -p <previous-commit-id>
git rebase -i -p 4d133f673250ed628e58371a8b246d68171fbbf9
.pick 2c6eece Feat: change some stuff
pick 1c6eece Feat: change server
# Rebase 4d133f6..2c6eece onto 4d133f6 (4 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <commit> = run command (the rest of the line) using shell
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# . create a merge commit using the original merge commit's
# . message (or the oneline, if no original merge commit was
# . specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
".git/rebase-merge/git-rebase-todo" 28L, 1267C
Stopped at 1c6eece... Feat: change server
You can amend the commit now, with
git commit --amend
Once you are satisfied with your changes, run
git rebase --continue
git rebase --continue
. In the case that we want to change the author need to execute the next commit.git commit --amend --author="Brayan Arrieta <correct-email>" --no-edit
git rebase --continue
Successfully rebased and updated refs/heads/feature/test.
git push origin <branch-name>
git push origin <branch-name>
command the next command, which will change the Git history of our branch with the fix.git push -f origin <branch-name>