first-contributions icon indicating copy to clipboard operation
first-contributions copied to clipboard

Issue with creating branch name using "git switch -c"

Open linahamila opened this issue 1 year ago • 4 comments

🐞 Problem When attempting to create a new branch using the command "git switch -c your-new-branch-name", if the branch name contains certain characters such as " ' " and "-", the command prompt appears as ">>" and no further commands can be executed until Ctrl+C is pressed.

🎯 Goal This issue is important to me as a beginner because it highlights a potential stumbling block for others who may not be aware that certain characters are not allowed in branch names. By addressing this issue, we can improve the user experience for newcomers to Git and avoid confusion in creating branches.

💡 Possible solutions One possible solution could be to update the documentation mention which characters are not allowed in branch names when creating branches using Git commands. Additionally, providing error messages or prompts when attempting to use disallowed characters could help users understand why their command is not working as expected.

linahamila avatar Apr 02 '24 19:04 linahamila

i don't think you are allowed to use single quotation marks when naming git branches.

On the other hand, I've been using dashes with my branch names ever since I started programing; without any errors.

Can you try to reproduce the issue and share your results for a better understanding?

kenshanta avatar May 06 '24 22:05 kenshanta

i don't think you are allowed to use single quotation marks when naming git branches.

On the other hand, I've been using dashes with my branch names ever since I started programing; without any errors.

Can you try to reproduce the issue and share your results for a better understanding?

sorry there was a typo I wasn't aware of, I meant the backslash character instead of "-"

linahamila avatar May 07 '24 20:05 linahamila

i don't think you are allowed to use single quotation marks when naming git branches. On the other hand, I've been using dashes with my branch names ever since I started programing; without any errors. Can you try to reproduce the issue and share your results for a better understanding?

sorry there was a typo I wasn't aware of, I meant the backslash character instead of "-"

If the issue is resolved then please close the issue.

Esh07 avatar Aug 20 '24 13:08 Esh07

@linahamila what's your stat?

kenshanta avatar Aug 20 '24 14:08 kenshanta