1

I have two branchs production and master .

in the master branch i create an svg image (icon.svg) with i lower case, i committed that icon.svg then push to Gitlab, then another developer create another image with Icon.svg same name same image but with I upperCase then he commited that image in production branch.

when he try to do a reabse of his branch to the master branch he do a git pull rebase in this way : (git pull origin master --rebase) it gives us Icon.svg unstaged and the D symbol for deleted a solution that I proposed to delete the icone.svg in the master and commit .. but that solution doesn't work it gives us the same problem in every rebase How we can solve this problem, thank you for your help

Badr MOUMOUD
  • 166
  • 2
  • 10
  • Decide which casing is correct and use that casing consistently. Did you push the change to master which deleted icon.svg? – Schwern Oct 01 '20 at 02:51

1 Answers1

0

If possible the developer should reset and rebase again.

But first rename the Icon.svg

git mv Icon.svg icon.svg

Once the case is the same, the new rebase should be easier.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • i ve triied that (but i m in windows 10) when i do that that cmd it shows me : "fatal :error destination icons.svg exist" – Badr MOUMOUD Oct 01 '20 at 12:41
  • @djopovitch What version of Git for Windows are you using? As I mention in https://stackoverflow.com/a/3921179/6309, this is supposed to work since Git 2.0.1 (June 2014): https://stackoverflow.com/a/24979063/6309 – VonC Oct 01 '20 at 12:45
  • i'm using Git with 2.19.2.windows.1 version, but doesn't work (⌣_⌣”) – Badr MOUMOUD Oct 01 '20 at 13:22
  • i saw the links , it work witth --force , git mv --force Icon.svg icon.svg – Badr MOUMOUD Oct 01 '20 at 13:24
  • but now i have a problem , when i want to do a checkout to the production branch (to rename the image in the production branch) form master , it refuse to go to the second branch it shows me `error: The following untracked working tree files would be overwritten by checkout: Icon.svg Please move or remove them before you switch branches. Aborting` – Badr MOUMOUD Oct 01 '20 at 13:50
  • @djopovitch To rename the second branch, it is best to clone the repository a second time, and switch to that branch, rename, commit and push from said second branch. – VonC Oct 01 '20 at 14:16
  • @djopovitch Regarding git mv, would that work with Git for Windows 2.28? 2.19 seems old at this point. – VonC Oct 01 '20 at 14:16
  • @djopovitch Or try with, in the repo: `git config core.ignoreCase true` (https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreignoreCase) – VonC Oct 01 '20 at 14:17