git in. gitignore can't refresh? Cannot refresh

Source: Internet
Author: User
Tags commit delete cache

To be able to ignore files that have been track, such as stopping tracking a file but not removing it from the repository. You can use the following command:

The code is as follows Copy Code

git rm–cached filename

The above command is used to delete a single cached file.

Delete cache directory Use the following command:

The code is as follows Copy Code

Git rm-rf–cached foldername

If you want to ignore a lot of files or folders, can not be deleted one by one.

Reset all caches, flush ignored files after commit

To run the command:

The code is as follows Copy Code

Git rm-r–cached.

This command will remove all cached indexes and then run the following command to add all the files:

The code is as follows Copy Code

git Add.

Submit it:

The code is as follows Copy Code

Git commit-m ". Gitignore is now working"

. Gitignore Other uses

Gitignore also has a usage, an empty. gitignore file can be considered as a placeholder. This becomes useful when you need to create an empty log directory for your project. You can create a log directory in which to place an empty. gitignore file. So when you clone this repo, Git will automatically create an empty log directory.

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.