Problem with git checkout command #47823
-
Select Topic AreaQuestion BodyI try to change my local branch and when i use this command: git checkout -d But, reading the documentation, does not exists this flag "-d". When I searched on the web, I didn't find anything about this flag. The "git checkout" command is used to switch between different branches or restore files to a previous state. The "-d" flag is not a valid option for this command. Testing on my machine using the git checkout -d command. I have these results. Tested by: khevin.karlospe@gmail.com | Khevin Karlos git user: |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Thanks for posting in the GitHub Community, @Khevinn ! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category, the Issues category is solely related to conversations around the GitHub products Issues and Projects. I've gone ahead and moved it for you. Good luck! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, i just try to help hahaha,
Em qua., 22 de fev. de 2023 às 13:51, Lili ***@***.***>
escreveu:
… Thanks for posting in the GitHub Community, @Khevinn
<https://github.com/Khevinn> !
We're happy you're here. You are more likely to get a useful response if
you are posting your question in the applicable category, the Issues
category is solely related to conversations around the GitHub products
Issues and Projects. I've gone ahead and moved it for you. Good luck!
—
Reply to this email directly, view it on GitHub
<#47823 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMMRH3Q2W7ITZMAI5E6SME3WYY7Z5ANCNFSM6AAAAAAU73SNCM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
That's odd, because it's described in the manual page, see here: https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt--d Asking ChatGPT is a very bad idea, it just confidently makes up stuff. 😉 |
Beta Was this translation helpful? Give feedback.
-
|
There's a "--detach" flag that allows you to check out a specific commit without creating a branch. To change your branch in, you can use |
Beta Was this translation helpful? Give feedback.

There's a "--detach" flag that allows you to check out a specific commit without creating a branch.
To change your branch in, you can use
git checkout <branch>