如何配置Git支持大小写敏感和修改文件名中大小写字母呢?(转)
2024-10-16 03:28:09
1. 在新建代码文件时,不注意把文件名应该小小写搞错了
2. 文件已经push到远程了
3. 在windows下面将文件名字改为全小写
改好后,在Git中没有任何反应,使用git status时,如果遇到下面情况,说明GIT大小写不敏感,如下:
1
2
3
4
5
6
|
[rock@ROCK-PC]$ /d/WampServer/www/hexu.org/code (dev)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
|
如何解决Git的大小不敏感问题呢?
1. 方案一是设置Git大小写敏感:
1
|
$ git config core.ignorecase false
|
2. 方案二是先删除文件,再添加进去:
1
|
$ git rm ; git add ; git commit -m "rename file"
|
由于我是与大家共用的仓库,所以我采用的方案2解决掉了。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
$ git rm code/library/BuildTag*.php; git status
On branch dev
Changes to be committed:
(use "git reset HEAD ..." to unstage)
deleted: code/library/BuildTagAfc.php
deleted: code/library/BuildTagAfs.php
rock@ROCK-PC /d/WampServer/www/hexu.org/code (dev)
$ git add code/library/BuildTag*.php; git status
On branch dev
Changes to be committed:
(use "git reset HEAD ..." to unstage)
renamed: code/library/BuildTagAfc.php -> code/library/BuildTagafc.php
renamed: code/library/BuildTagAfs.php -> code/library/BuildTagafs.php
|
http://blog.hexu.org/archives/1909.shtml
最新文章
- 看看国外的javascript题目,你能全部做对吗?
- Kafka0.10的新特性一览
- Code4App地址
- Github账户注册的过程
- SQLSERVER存储过程基本语法
- POJ 2524 Ubiquitous Religions
- 磁盘操作- inode/Block深入实战
- 【转】JavaScript中的this关键字使用的四种调用模式
- java 堆栈 静态
- [转]oracle EBS 基础100问
- Myeclipse 搭建Java Web 项目:Servlet 《二》
- DOM编程从入门到忘记
- Android 开发第一项目——计算器的开发记录
- 运用node真机调试移动web项目
- Kubenetes---Service--实践
- Git&;GitHub-基础教程
- LaTeX Error: Something's wrong--perhaps a missing \item
- KnockoutJs学习笔记(三)
- Altium Designer9.4局域网内冲突的问题
- JAVA方法参数传递
热门文章
- Android 判断当前线程是否为主线程
- MSDN 杂志:UI 前沿技术 - WPF 中的多点触控操作事件
- mysql 表级锁
- [思路]为什么要做一个Web服务器
- iphone分辨率终极指南(含有iphone6/6+)
- PHP - 操作符与控制结构
- C语言,数据类型
- Ember.js - About
- 编写高质量代码改善java程序的151个建议——[52-57]String !about String How to use them?
- Swift - 使用CABasicAnimation实现动画效果