Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing a file after doing git commit, verify its not in the master

Tags:

git

I added a 50mb file or so and did a git commit.

I starting doing a :

git push origin master

But mid-way I cancelled the operation.

  1. how can I remove this file from the repo even though I did a git commit (I added it to .gitignore now but its sort of late)
  2. how can I see if the file is in the master or not?

I don't want to wipe the entire commit as there are other files I want commited (and not lost).

like image 583
Blankman Avatar asked Nov 13 '22 22:11

Blankman


1 Answers

Good that you cancelled it.

Remove the giant file.

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

You should be fine.

like image 177
Adam Dymitruk Avatar answered May 21 '23 04:05

Adam Dymitruk