Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

sync problem with file with lower case and upper case #1520

Open

Description

@knupel

Hello,
the name file is not changed when it's just type case is changed.
That can cause a trouble when we come back to old version or when other people download the file.
Or maybe I miss something to update the filename when the changement is only a upper case or lowr case.
Capture d’écran 2019-03-13 à 11 43 57
Capture d’écran 2019-03-13 à 11 45 58

Activity

  1. knupel commented on Mar 13, 2019

    @knupel
    Author

    Maybe more explicit:
    Capture d’écran 2019-03-13 à 12 26 14

  2. oprogramador commented on Mar 13, 2019

    @oprogramador

    @StanLepunK

    It's not about GitHub. It's a local problem on Mac.

    A workaround if you want to change the case:

    • remove all the files which case you want to change
    • git add .
    • git commit -m 'remove files'
    • for each file git checkout your-branch your-file
    • for each file mv UPPERCASE_NAME lowercase_name
    • git add .
    • git commit -m 'add files'
    • git rebase -i HEAD~2
    • for the second commit, replace pick with squash
    • write down your desired commit message
  3. knupel commented on Mar 14, 2019

    @knupel
    Author

    hmmm thx for the advice but i'm not really confortable with this type of operation: I figure, I must do that in the terminal to targeting the folder of my project ?

  4. TPS commented on Mar 14, 2019

    @TPS
    Collaborator

    @StanLepunK Did you contact GitHub support? What'd they say?

  5. knupel commented on Mar 15, 2019

    @knupel
    Author

    Yep I contact us, but I don't have a time now to solve it, but i do that asap. If I understand well the support say the solution of @oprogramador is not really optimum because that can erase my file history. the fix proposition is :

    Hey there Stan,
    Thanks for writing in and I hope you are having a great day where you are.Taking a look at that issue, as the user mentions, it looks like it might be a local issue with your repository.
    Can you try, locally, running:$ git mv :old_filename :new_filename Then run $ git commit -a -m ":commit_message" By using the git mv command you are telling git to move/rename the file - and by doing so continue to track the changes. In #1520 the commenter has mentioned removing and readding the files to git, this will destroy the history of these files - which is still a valid method if that's the desired process you have.
    I hope this helps and please let me know if you face any further issues with this.Thanks Matt Barber

  6. TPS commented on Mar 15, 2019

    @TPS
    Collaborator

    That seems very odd that @github would treat it like that.… But I suppose they're making the easy assumption. Still, the appropriate section @ Wikipedia currently says (emphasis mine)

    In filesystems in Unix-like systems, filenames are usually case-sensitive (there can be separate readme.txt and Readme.txt files in the same directory). MacOS is somewhat unusual in that, by default, it uses HFS+ in a case-insensitive (so that there cannot be a readme.txt and a Readme.txt in the same directory) but case-preserving mode (so that a file created as readme.txt is shown as readme.txt and a file created as Readme.txt is shown as Readme.txt) by default. This causes some issues for developers and power users, because most other environments are case-sensitive, but many Mac Installers fail on case-sensitive file systems.

  7. oprogramador commented on Mar 17, 2019

    @oprogramador

    @StanLepunK @TPS

    Anyway I think, it's not a GitHub issue. It's just about how git and operating systems work.

  8. TPS commented on Mar 17, 2019

    @TPS
    Collaborator

    @oprogramador I disagree. The git|GitHub client should preserve case, even in cases when the OS &/or filesystem don't. Since MacOS does, I don't understand the above behavior @ all.

  9. user4i commented on Jan 2, 2020

    @user4i

    📌📌📌
    If you need to commit files renaming, just capitalization, and you have a problems with staging/commiting, as option

    1. Change capitalization of "file" name and add "1" to the end (or other symbol)
    2. Stage (without commit) = result "File1" - renaming files
    3. Remove "1" from the end
    4. Stage (without commit) = result "File" - renaming files (only capitalization now)
    5. Do commit.

    Update March 2021: These steps are more useful to apply in visual code editor like vscode or visual git tool. For command line see Option 2 proposed by @coolzoom in #1520 (comment)

  10. knupel commented on Jan 5, 2020

    @knupel
    Author

    thanks for the tip

  11. ivnlabs commented on Mar 11, 2021

    @ivnlabs

    📌📌📌
    If you need to commit files renaming, just capitalization, and you have a problems with staging/commiting, as option

    1. Change capitalization and add "1" to the end (or other symbol)
    2. Stage (without commit) = result "R" - renaming that files
    3. Remove "1" from the end
    4. Stage (without commit) = result "R" - renaming that files (only capitalization now)
    5. Do commit.

    THANKS THIS DO THE JOB DONE

  12. coolzoom commented on Mar 31, 2021

    @coolzoom

    📌📌📌
    If you need to commit files renaming, just capitalization, and you have a problems with staging/commiting, as option

    1. Change capitalization and add "1" to the end (or other symbol)
    2. Stage (without commit) = result "R" - renaming that files
    3. Remove "1" from the end
    4. Stage (without commit) = result "R" - renaming that files (only capitalization now)
    5. Do commit.

    Epic tips! Thanks.
    also, I found no need stage if you use git mv to rename.
    for anyone who wishes to try, below are the examples of renaming a folder.

    Option 1 example based on @user4i :

    mv Folder folder1
    git stage .
    mv folder1 folder
    git stage .
    git add .
    git commit -a -m ":commit_message"

    Option 2 example based on #1520 (comment)

    git mv -f Folder folder1
    git mv -f folder1 folder
    git add .
    git commit -a -m ":commit_message"

  13. user4i commented on Mar 31, 2021

    @user4i

    also, I found no need stage if you use git mv to rename.
    for anyone who wishes to try, below are the examples of renaming a folder.

    Good idea! But stage is more convenient and quick to apply these steps #1520 (comment) in visual code editor like vscode or visual git tool. Additionally Option 2 was not so easy to apply, may be because of my OS/git settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions