git rebase merge commits to solve the problem that commits with more than 100M files cannot be pushed

git log

Now you can see that there are 3 submissions:
change 1.mp4 size to small //Found that it cannot be pushed, and changed it back to less than 100M
add 1.mp4 big Change it to more than 100M
add 1.mp4 Add a file less than 100M

commit 0b265673698e336557c781286dbc89bc89f2193f (HEAD -> master)
Author: kingBook <[email protected]>
Date:   Fri Apr 27 11:19:10 2018 +0800

    change 1.mp4 size to small

commit 1441e74583ff80e4c65b01174cbfa39f45c9e811
Author: kingBook <[email protected]>
Date:   Fri Apr 27 10:41:53 2018 +0800

    add 1.mp4 big

commit 8ae0ddd75875a030122aa36ab7cd7c97c6c1c8ee (origin/master)
Author: kingBook <[email protected]>
Date:   Fri Apr 27 10:39:46 2018 +0800

    add 1.mp4

Enter: wq to exit and return to the command line.
Now delete the commit "add 1.mp4 big", or merge it into other commits, otherwise it cannot be pushed to the remote warehouse

git rebase -i HEAD~3

You can see the info window for the last 3 commits:

pick 8ae0ddd add 1.mp4
pick 1441e74 add 1.mp4 big
pick 0b26567 change 1.mp4 size to small
//以下省略

Now we merge "add 1.mp4 big" into "change 1.mp4 size to small"
just change the pick in front of them to s or squash.

pick 8ae0ddd add 1.mp4
s 1441e74 add 1.mp4 big
s 0b26567 change 1.mp4 size to small
//以下省略

Then, ctrl+C to quit editing and enter :wq to return to the command line,
and then it will display asking you to enter the revised submission information, delete the required submission information "add 1.mp4 big", and enter :wq again to return to the command line.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324972989&siteId=291194637