Clean history : remove delete actions and ignore some files

Say I’ve got project A with this history :

  • HEAD : Hotfix
  • HEAD~1 : Changelog
  • HEAD~1 : Dev
  • HEAD~2 : Feature
  • HEAD~3 : Typo

And I started project B on top of that history, getting to this :

  • Is this the correct way to resolve conflicts from a git pull/merge?
  • SourceTree - Git Rebase resulting in automatic merge
  • GIT Weekly Activity
  • Git: file on remote server is not being overwritten with updated version on merge
  • rebase to squash multiple commits on same branch
  • How do I get the output from a call to GIT into a variable in a batch script?
    • HEAD : Changelog
    • HEAD~1 : Clean repo
    • HEAD~2 : Delete unnecessary files
    • HEAD~3 : Hotfix (project A)
    • HEAD~4 : Changelog (project A)
    • HEAD~5 : Dev (project A)
    • HEAD~6 : Feature (project A)
    • HEAD~7 : Typo (project A)

    Now I’ve got a clean project B and I’d like to start my next apps with a fork of this one.

    Problem is the bold commit : it deletes files. I would like to rewrite the history to omit that action, preventing merges from the base repo to project A to delete my files altogether.

    Ideally, the deleted files should never appear in project B’s history.

    This might be a duplicate question of “Delete commits from a branch in Git”, “Completely remove file from all Git repository commit history” or “GIT How to clean history pack for old deleted files?” but it might not as the problem exposed is pretty specific.

    Please share you experience with the community!

  • Opening a file in Vim opens vim diff?
  • How to set a git branch to push to a remote with a different branch name and pull from completely different url
  • OpenShift action_hooks are not executable
  • Git - How to split code in a feature branch in such a way that future merges/rebases from master don't remove the code from the feature branch
  • How to avoid PhpStorm staging file on Refactor > Rename
  • Can I use Git for source control and still be SOX compliant?
  • Git Baby is a git and github fan, let's start git clone.