Git commit: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:
=Apply Extra Changes to the Latest Commit=
=Apply Extra Changes to the Latest Commit=


{{Warn|If the latest commit that has been amended was pushed in a remote repository, you will need to overwrite it in the remote repository - thus rewriting history - with
{{Warn|If the latest commit that has been amended was pushed in a remote repository, you will need to overwrite it in the remote repository - thus rewriting history - with:
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
  git push --force
  git push --force
</syntaxhighlight>
</syntaxhighlight>
This is not necessary if the last commit was not pushed yet.
}}
}}



Revision as of 02:10, 31 August 2019

External

Internal

Overview

Apply Extra Changes to the Latest Commit


If the latest commit that has been amended was pushed in a remote repository, you will need to overwrite it in the remote repository - thus rewriting history - with:
 git push --force

This is not necessary if the last commit was not pushed yet.

Update a Commit Message that Has Not Been Pushed Yet

git commit --amend

It will start an interactive editor.

Deleting Commits from History

Deleting Commits from History