Solution for git version management. gitignore does not work

Source: Internet
Author: User

I. Problems

After a project cloned from the server is repaired locally and some cached files are generated, confirm that the project can be submitted to the remote branch, the cache file is included in the scope of submission. check the gitignore file and find that the directory of the cached file has been included in the ignore queue. This indicates that the ignore file does not take effect.

Ii. cause of the problem

After a new understanding of git version control, we found that those directories that do not take effect are because these directories or files have been staged, that is, these files or directories have been included in version control management, as a result. invalid gitinore File

Iii. Solution
 
1GitRm-R --Cached.2 Git add.3Git commit-m'Update. gitignore'

GitRm-r --Cached.Clear the temporary storage area.

Solution for git version management. gitignore does not work

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.