github - How to modify or remove older commit in Git? -
from past few days had kept on adding , committing files in local. branch 16 commits ahead of 'origin/master'.
i wanted push them git repo 1 of file being large push command fails. there way remove commit stash or have hard reset on head.
- you can use squash
- bfg
- move head previous commit (link)
squash
# edit commits given sha-1 git rebase -i <sha-1>
but 1 of file being large push command fails...
how remove big files repository
you can use git filter-branch
or bfg. https://rtyley.github.io/bfg-repo-cleaner/
bfg repo-cleaner
an alternative git-filter-branch.
the bfg simpler, faster alternative git-filter-branch cleansing bad data out of git repository history:
* removing crazy big files*
* removing passwords, credentials & other private data
examples (from official site)
in these examples bfg alias java -jar bfg.jar.
# delete files named 'id_rsa' or 'id_dsa' : bfg --delete-files id_{dsa,rsa} my-repo.git
Comments
Post a Comment