How does git delete previous submission records while retaining the current content?

I have a remote repository, and then I clone it locally and submit it many times locally.
there are many pictures in the submission history (various deletions and corrections).

I would like to ask, if I push, will deleted images (once commit to the local warehouse) be recorded and submitted?

is there any way to discard all past commit records while keeping the current warehouse status?

my actions are as follows

  1. clone remote warehouse to local
  2. add a bunch of pictures to the local warehouse, add and then commit to the local warehouse
  3. the local warehouse deleted the picture, add and then commit to the local
  4. at this time I push , will the image added in step 2 be submitted to the remote repository?
Mar.11,2021

there will be a submission record. Can be traced back to the source, if you want to erase the record. no, no, no.
you can learn about rebase (use this as little as possible)


rebase. You can merge all the previous commit into a


remote warehouse that will be submitted. How about locally? after submission, what about the remote warehouse


there is a relatively simple method, if you want to merge the last two changes,

git reset-- soft HEAD~2

and then re-commit it.


git stash
Git reset-- hard HEAD~2
Git stash pop

Menu