Git remove version control action __git Remove version control action

Source: Internet
Author: User

First, use the git RM command

1. Preview the file you want to delete

Execute git rm-r-n--cached "bin/"   , which shows the file table preview to be deleted

2. Remove version Control actions

Execute git rm-r--cached  "bin/"     to delete the file's command. 
Execute git commit-m "Delete bin file"    , submit and annotate
execute GIT push Origin master   , submit to remote server

Note: This deletion retains the local file if the delete server file can not use push.


When we need to delete a file on a registers or branch, and the workspace does not need this file , you can use the

1 git rm file_path
2 git commit-m ' delete somefile '
3 git push

When we need to delete the file on the registers or branch, but we need to use it locally, we just don't want this file to be version controlled, you can use

git rm--cached file_path
git commit-m ' delete remote somefile '
git push

More:

Git back to the specified version command

Use Git to get the latest version to the local

To delete a remote branch on a github

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.