简体   繁体   中英

Git unstage committed files before push

I am trying to start over with adding and committing files before I push. Every time I type in git push origin master -f I get an error saying files are too big.
I want to unstage all files that are about to be pushed, so I can reselect the ones I want to push. I tried

git reset --soft HEAD~1
git rm -r --cached . -f

Then I type git diff --stat --cached origin/master and still see all the files. I have also tried git reset HEAD and also git reset . Even after the resets I try to push and I still get the errors saying I am trying to push too big of file. How do I reset this? I want to keep all of the changes I have made on my local copy.

git reset -- *

unstages the files in the index, but leaves them in the working directory.

git reset --mixed HEAD~1

will also unstage files from the index when you reset the branch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM