I'm following the instructions on how to add an existing project to GitHub from GitHub docs. However, I get an 'gh' is not recognized as an internal or external command, operable program or batch file.
error message when I try to use gh repo create fs1
command in the project root directory as instructed. Here fs1
is my project name. I browsed StackOverflow but couldn't find any help yet. What am I missing?
The page you are following doesn't include the instructions to install the GitHub CLI, so it is likely you don't have it installed (it doesn't come with git as far as I know).
Installation instructions can be found here: https://cli.github.com/
fs1
on GitHub earlier but I deleted it to try the creation from command prompt. Now I managed to create it from there, but I get these already exists
-type of errors no matter what I try to do with it. –
Oliva git branch -M main
and then git push -u origin main.
Now mt repo looks like this: fs1 –
Oliva git
, it would enable me to use gh
command from Git Bash
? However when I try and do gh repo create my-project-name
I get bash: gh: command not found
. When I run $ git version
I get git version 2.33.1.windows.1
. Do I have to download and install GitHub CLI
from cli.github.com as well as have git
installed? And then gh
will be available from Git Bash
? Update: Yes, that seems to work, was prompted to authenticate with gh auth login
beforehand. –
Atherosclerosis brew install gh
–
Sheer gh
is github cli.
Install github cli:
windows
choco install gh
( choco is installed with nodejs most of the time )
mac
brew install gh
for linux: https://github.com/cli/cli/blob/trunk/docs/install_linux.md
winget install GitHub.cli
might be a better command for windows, as winget should be installed by default now –
Nicodemus I had the same issue. I didn't have gh installed.
I installed the gh, but the same error occurred.
I checked the environment variables and gh location was there.
I restarted windows, the error went away :)
Actually, with Windows 10 or 11, to avoid having to download even more crap, use:
winget install --id github.cli
This can be done straight from the VSCode Terminal.
© 2022 - 2024 — McMap. All rights reserved.
error: remote origin already exists.
error whilte creating it. – Oliva