How can I remove/delete a large file from the commit history in the Git repository?

Use the BFG Repo-Cleaner, a simpler, faster alternative to git-filter-branch, specifically designed for removing unwanted files from Git history. Carefully follow the usage instructions. The core part is just this: java -jar bfg.jar –strip-blobs-bigger-than 100M my-repo.git Any files over 100 MB in size (that aren’t in your latest commit) will be removed from your Git … Read more

How to merge git commits in the develop branch to a feature branch

To integrate one branch into another, you have to either merge or rebase. Since it’s only safe to rebase commits that aren’t referenced anywhere else (not merged to other local branches; not pushed to any remote), it’s generally better to merge. If your feature branch is purely local, you can rebase it on top of … Read more

GIT undo a commit that isn’t the most recent, rebase all commits since

The easiest way to do what you want is to stay on (or re-checkout) the branch that you want to edit and run something like this. git rebase –onto <sha1-of-bad-commit>^ <sha1-of-bad-commit> This will rebase everything since the bad commit onto the bad commit’s parent, effectively removing the bad commiit from your current branch’s history. Of … Read more

Issues with Git – rebase / squash

The problem is that when sublimetext2 is started, it doesn’t block and immediately returns. Git then thinks that you’re done editing the file and performs the rebase. That’s why you see the Successfully rebased and updated refs/heads/staging message, before you even edited the file. Use the subl command instead, which is designed for such use. … Read more