IntelliJ and Git checkout
Answered
So when using IntelliJ when I checkout a branch name

Notice the case for "feature"
but when I look at the status or Push to new Branch it changes the case and it's causing bit of confusion.

Any reason for this changing of the case? Is it Git issue or IntelliJ issue?
Git version:

thanks
Please sign in to leave a comment.
What is the output of the git branch command?
When you check out, you should be prompted fro a branch name, what do you enter there?
I keep it default which how the branch is named.
Changes the case now the branch name is different. Why is it doing this?
It does not happen to me. What is the output of the git branch command?
now when i PUSH...
The case changes. This is causing a lot of confusion.
Joseph, I understand the issue. But his does not happen to me - on my Windows machine the case is preserved.
Please go tp the command lien and execute git branch
How is the branch called in the output?
typed git branch
This is the log when I checkout the branch.
happens for every branch i checkout when it is not capitalized
Seems IDE passes name correctly.
If you do the git checkout -b feature/CTTEST origin/feature/CTTEST from the command line, does the name also cahnge?
What is the git config core.ignorecase value?
What IDEA version are you on? What Windows version?
Hi,
I'm using idea version:
Windows 8.
So, as I understand, after you checkout from the command line, the git branch output also shows branch name starting with a capital. Please confirm. Seems a git issue.
Seems a git, or OS issue. I suspect it is related to folder names. When you create a branch called feature/CTTEST, what actually happens is a folder called feature created in .git/refs/heads folder. Probably, OS capitalizes the folder name for some reason.
Setting git config core.ignorecase true could help here
See also:
http://stackoverflow.com/questions/15371866/why-is-git-capitalizing-my-branch-name-prefix
http://stackoverflow.com/questions/13828066/how-do-i-solve-a-folder-capitalization-conflict-with-git-on-windows
so when i use git branch it does not capitalize.
It's locally in IntelliJ shows it capitalized in the status bar bottom right corner. When I push it sees it as a new branch. Git shows everything correctly i feel like it's intelliJ that is doing some case manipulation.
It's only when i use the git plugin with intelliJ.
I've tried both true and false for git config core.ignorecase
To make sure we are on the same page.
When you checkout using IDE, the git branch shows Feature/CTTEST (as on one of the screenshots above)
When you do git checkout -b feature/CTTEST origin/feature/CTTEST in the command line, the git branch shows feature/CTTEST, while the IDE still shows Feature/CTTEST.
IDE should show exactly the same as git branch, at least it work this way on me machine.
If you go to <Your_project_Dir>/.git/refs/heads, how is the feature folder called there?
Hi Dmitriy,
Yup that solved it. I had an empty folder called Feature inside ./git/refs/heads. Once i deleted the empty folder and then checked out the branch that fixed it.
thanks for your assistance.
So now my question is since git server git sees "Feature" and "feature" as two different branch how can window handle that situation? because you can't create a folder called "Feature" and "feature" in windows. I'm assuming we have to go through git and rename all the folders on the git server and set a standard. I guess i answered my own question.