Git: Push changes after “git rm”

I deleted a file using git rm test and currently this is the output of git status .

Noob@Noob:/media/data/bitbucket/pythonscripts$ git status .
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       deleted:    test
#

Now when I try to push the change in my repo using git push it says Everything up-to-date. I understand that normally one needs to first add and than commit before push but in my case what do I add beacause I have already deleted the file.

  • Importing from Bitbucket to Stash with history?
  • How to deploy my bitbucket code easily to my production server
  • Unable to pull from bitbucket or github repository using sourcetree
  • ZF2 private repository for project
  • Configuration of 2 Bitbucket accounts on one laptop: cannot clone code
  • Xcode 5: The repository could not be reached
  • Also if I do git commit -m "commit message" will this override all my commits because currently I have no file to attach this commit to.

  • How to include ReactiveCocoa 3.0 in Xcode 7 project
  • Installing laravel on existing project
  • Git fake squashing
  • Php get Commit list of specfic Git Branch
  • Git branching strategy for Agile project
  • How can I reliably track changes on deployed websites?
  • 2 Solutions collect form web for “Git: Push changes after “git rm””

    After doing git rm you need to do git commit. Git says that Everything up-to-date is because you have not created a commit with this file removed.

    For example if you do git reset --hard you’ll see that your file is back.

    In general git rm is no different from git add.


    will this override all my commits

    No it won’t, it will create a new commit with this file removed.

    There are three steps to answer your question.

    1. git rm #your_files
    
    2. git commit -m "#your_comments"
    
    3. git push origin #your_local_branch:#your_remote_branch
    
    Git Baby is a git and github fan, let's start git clone.