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.

  1. you can use squash
  2. bfg
  3. move head previous commit (link)

squash

# edit commits given sha-1 git rebase -i <sha-1> 

enter image description here


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 

enter image description here


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -