I have generated and added my SSH key into Github.
Now I'm trying to write a script which generates a new private repository in Github and upload intiial files. User will be prompted for the name of the new repository.
The code that I have is given below. The problem is that when trying to push files into Github I get the following error
ssh: Could not resolve hostname github.com:rongardF: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Why do I get this error? Is there anything else that I have to do?
The code:
@echo off
set /p name="Enter new project name: "
touch README.md
touch .gitignore
echo __Previews>>.gitignore
echo History>>.gitignore
echo Project Outputs *>>.gitignore
echo * Logs *>>.gitignore
git config --global user.email "r****n@gmail.com"
git config --global user.name "R** F****"
curl -u r***F:p*****d https://api.github.com/user/repos -d "{\"name\":\"%name%\",\"private\":true}"
git init
git add .
git commit -m "Initial commit"
git remote add origin git@github.com:r***F/%name%.git
git push -u origin master
NB: The names obviously don't include "*" symbol, this is just for blurring out my details.