How to remove ignored files from current commit using git commit --amend -


i made commit contains lot of .o files want ignore. created .gitignore file , made default global (i put home , did git config --global core.excludesfile ~/.gitignore).

now need amend commit these files no longer in before push. doing git commit -a --amend leave ignored files in commit.

i need re-apply these new ignore rules on existing commit before push it

how fix it?

do a:

$ git reset --soft head^ 

and see changes you've made commit staged. unstage unwanted files , commit wanted ones:

$ git reset head *.o $ git commit -m "commit msg" 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -