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

1
14 comments

 

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?

 

0
Avatar
Permanently deleted user

I keep it default which how the branch is named.

 

Changes the case now the branch name is different.  Why is it doing this?



 

1

It does not happen to me. What is the output of the git branch command?

0
Avatar
Permanently deleted user

now when i PUSH...

The case changes.  This is causing a lot of confusion.

0

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?

0
Avatar
Permanently deleted user

typed git branch

This is the log when I checkout the branch.

0
Avatar
Permanently deleted user

happens for every branch i checkout when it is not capitalized

and causes issue when i PUSH.


 

0

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?

 

0
Avatar
Permanently deleted user

Hi,


I'm using idea version: 

Windows 8.

 

0

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

 

0
Avatar
Permanently deleted user

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 

0

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?

0
Avatar
Permanently deleted user

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.

0
Avatar
Permanently deleted user

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.

0

Please sign in to leave a comment.