Home > Mobile >  Pushing with the the last commit to git
Pushing with the the last commit to git

Time:09-16

Let's say that I fixed an issue but I don't want to add a new commit. Is it technically possible to push changes without any new commit? (As part of previous commit?) If possible, how would the git log be affected with this?

CodePudding user response:

Is it technically possible to push changes without any new commit

No. Commits are the only things that Git deals in, and they cannot be modified. You could replace the most recent commit with a commit that includes the fix (using --amend), but that would still be a new and different commit (and pushing it would be very bad if this is shared history).

Discovering bugs and fixing them in a new commit is what Git is all about. Do not try to subvert it. Use Git, don't fight it.

  •  Tags:  
  • git
  • Related