Git file name capitalization issues

Source: Internet
Author: User

Reproduced in: https://www.yangrunwei.com/a/52.html

Stepping on the git pit.

Under Windows, a coinlog.js file was submitted at the beginning, and later renamed to Coinlog.js, it was not submitted. Git hints are not changed. Later, it turns out that git is not sensitive to file name capitalization by default.

How to fix git file name capitalization problem scenario 1, configuring Git

The first thing you can do is to configure GIT to identify the case of file names. The command is as follows:

    1. git config core.ignorecase false

The disadvantage is that each warehouse needs to be modified.

Scenario 2, Manual modification

1. First delete the target file stored in the Git local repository, take coinlog.js as an example

    1. git rm coinLog.js

Or

    1. git rm -f coinLog.js

-F means forced deletion.

2. Modify the file name
Modify the Coinlog.js file name to Coinlog.js

3. Add files to the local repository

    1. git add coinlog.js

4. Submit to local warehouse and remote repository

      1. git commit -m ‘rename file‘;
      2. git push

Git file name capitalization issues

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.