简体   繁体   中英

git: remove an uncessary file from commit after push

How can I do to remove file (f2) that should not be added in this branch?

I did:

git add f1
git add f2
git commit -m 'add files f'
git push origin branch0

Let's say that i don't want to delete it from git, i want just to not add in a special commit.

Thank you,

you can do following: Below changes will replace your previous push with new one

  1. git reset HEAD^ then do any changes you want
  2. git add.
  3. git commit -m "your message"
  4. git push origin branch0 --force-with-lease

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