Deleting a file after running git commit, check it is not in the main

I added a file of 50 MB or so and made g it commit.

I'm starting to do:

git push origin master

But in the middle I canceled the operation.

  • How can I remove this file from the repo, although I did a git commit (now I added it to .gitignore, but its kind of late)
  • How can I find out if a file is in master or not?

I do not want to destroy the entire commit, as there are other files that I want to commit (and have not lost).

+5
source share
3 answers

Good thing you canceled it.

Delete the giant file.

git add -A
git commit --amend -C head
git push origin yourbranch

You must be fine.

+2
source

Step One DO NOT SUBMIT If you clicked, report back after you have done something decisive.

: , ?

- lastcommit: git commit --amend

- : man git-rebase

: man git-filter-branch, , .git-. , .

: , , . .

:

0
-1

All Articles