Replace all files in git repo with the files that are on local machine

I want my git repository to look exactly like I have it locally.

As in if I have A,B,C,D and E files in my git repository and on my local machine I have deleted A,B and C, leaving D and E. When I push I want to see only D and E in the repository. how can I do this please. Also can I do the same with on heroku ?

  • Some email addresses appear to contain a newline?
  • Why doesn't Git remove some files when I switch a branch?
  • Managing website with git on a existing website
  • No such file or directory - git ls-files — WINDOWS
  • Importing commit from Bitbucket to Existing Gitlab repo
  • Why does merging these branches do nothing?
  • Git work flow with an inexperienced member
  • Push and pull branches in Git
  • Emulate git cp, including files with spaces in names
  • Is it possible to clone git config from remote location?
  • git + dropbox problem
  • How do you know which branch that a newly created branch will be based off of?
  • One Solution collect form web for “Replace all files in git repo with the files that are on local machine”

    Stage all changes, make a commit, and push.

    git add -A
    git status
    git commit -m "Deleted A, B, C"
    git push
    Git Baby is a git and github fan, let's start git clone.