I push to GitHub frequently, without much headache. I’m OK with navigating git issues mostly. I’m not clear on why I can’t add/commit/push my local create-react-app (it is literally the stock app with no changes) to GitHub.
I create the react app, then I create the GitHub repository, and then on my local PC I set the remote using git remote add origin git@github.com:jcomp-03/codeforsofl.git
. Afterwards I add, commit, and try pushing my changes using git push -u origin main
. I get the following error:
If I did not know better, GitHub (i.e. the remote) is interpreting that ___ (blank) is not a valid repository name? I don’t know what to make of it. Thoughts, community?
asked Nov 9, 2022 at 5:33
3
I hit this a few times too and ultimately re-made the remote repository to fix it, which worked. I’ve only encountered this with brand new (on Github’s side) repositories while trying to push a repo I’d made on my machine to GH.
Since git remote -v
returned that fetch and push origins were respectively set correctly, it was the only logical thing to do since re-making the empty remote repo is less effort that reaching out for support.
answered Mar 5 at 22:14
Tim PostTim Post
33.2k15 gold badges110 silver badges173 bronze badges
This looks really odd:
$ git remote -v origin git@github.com:edgarflopez/run-buddy.gitgit@github.com:edgarflopez/run-buddy.git (fetch) origin git@github.com:edgarflopez/run-buddy.gitgit@github.com:edgarflopez/run-buddy.git (push)
It looks like your remote repository URLs got duplicated somehow, maybe a copy&paste error? Whatever the cause, you can fix the URL with git remote set-url
:
$ git remote set-url origin git@github.com:edgarflopez/run-buddy.git
$ git remote set-url --push origin git@github.com:edgarflopez/run-buddy.git
3 replies
Thank you! That worked!
At first when I did the git remote commands — nothing happened but then I went and did a git push origin main command again and it worked!
I sure do appreciate that.
Glad to hear it worked! And yes, that’s how it’s supposed to work: The set-url
commands fixed the URLs, and after that push
had a valid remote URL to use. Marking the solution would be appreciated. 🙂
Loading
Доброго времени суток!
При использовании команды git push -u origin master
вылетает ошибка
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to t
he list of known hosts.
fatal: remote error:
is not a valid repository name
Email support@github.com for help
С чем это может быть связано и с чего можно начать разбираться?
Действия были таковыми
git init
git add -A
git commit -m "header first"
git remote add origin git@github.com:yourname/yourproject.git
-
Вопрос заданболее трёх лет назад
-
11878 просмотров
@morflot с репозиторием разобрались. Теперь про git push. Учитесь читать что оно вам пишет.
Оно пишет что в master уже есть коммиты, которых у вас нету. Варианты: сделать git pull —rebase, или, если изменения которые уже лежат на сервере вам не нужны — git push —force.
Пригласить эксперта
Если я правильно понимаю то: «Warning: Permanently added the RSA host key for IP address ‘192.30.252.128’ to t
he list of known hosts.»
SSH не знает этого IP. Вам
tsarevfs кинул линк, смотреть надо видимо где «Check your SSH access»
-
Показать ещё
Загружается…
21 июн. 2023, в 23:43
5000 руб./за проект
21 июн. 2023, в 23:34
10000 руб./за проект
21 июн. 2023, в 22:52
600 руб./за проект
Минуточку внимания
Я создал новый репозиторий Github, но, похоже, я не могу нажать на него или клонировать его, когда я пытаюсь нажать через SSH-ключ, я получаю эту ошибку:
fatal: remote error:
is not a valid repository name
Visit https://support.github.com/ for help
И при попытке HTTPS я получаю:
fatal: unable to access 'https://github.com/name/repo.git~/': The requested URL returned error: 400
Я пытался нажать и клонировать старый репозиторий, и он работал нормально, но не работает с новыми репозиториями. Я также пытался удалить свои учетные данные из диспетчера учетных данных, но это не сработало, я попытался изменить ключи SSH на своем компьютере и в своей учетной записи Github, и это также не работает,
1 ответ
Для HTTPS попробуйте:
cd /path/to/repo
git remote set-url origin https://github.com/name/repo.git
^^^
(no trailing ~/)
Для SSH:
cd /path/to/repo
git remote set-url origin git@github.com:name/repo.git
0
VonC
4 Июл 2022 в 10:11