Github: ERROR: Repository not found. fatal: The remote end hung up unexpectedly (different) - github

This is my code:
$ git clone https://github.com/Perrydu/jekyll-plumbious.git Perrydu.github.com
$ cd Perrydu.github.com
$ git remote set-url origin git#github.com:Perrydu/Perrydu.github.com.git
$ git push origin master
The terminal:
Last login: Sat Oct 6 19:54:15 on ttys000
Dus-MacBook-Pro:~ Perry$ $ git clone https://github.com/Perrydu/jekyll-plumbious.git Perrydu.github.com
-bash: $: command not found
Dus-MacBook-Pro:~ Perry$ git clone https://github.com/Perrydu/jekyll-plumbious.git Perrydu.github.com
Cloning into Perrydu.github.com...
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 34 (delta 3), reused 30 (delta 3)
Unpacking objects: 100% (34/34), done.
Dus-MacBook-Pro:~ Perry$ cd Perrydu.github.com
Dus-MacBook-Pro:Perrydu.github.com Perry$ git remote set-url origin git#github.com:Perrydu/Perrydu.github.com.git
Dus-MacBook-Pro:Perrydu.github.com Perry$ git push origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
Dus-MacBook-Pro:Perrydu.github.com Perry$
jekyll-plumbious.git is my project like jekyll-bootstrap.

I assume that you're following the steps described here:
http://jekyllbootstrap.com/
It looks from your GitHub account as if the problem is that you've created a repository with the name perrydu.github.com, but the repository you're referring to with the URL of origin is Perrydu.github.com. The names of GitHub repositories are case sensitive, so I would go into the GitHub admin interface for the lowercase-named repository (perrydu.github.com) and rename it to Perrydu.github.com.
Then, after a couple of minutes, the push command you tried before should work.

Related

Why cant I upload any new project to GitHub?

I have been going at the endlessly all semester. I was able to add project from my prior year in school but have been unable to push and new projects to my repository.
I have tried deleting my key credentials via my key access chain.
I have created a new GitHub account and tried using that one.
I have deleted repositories started from scratch over and over.
I have read question on question and tried following multiple different answers on here.
What I wouldn't give to understand what is going on and why nothing seems to allow me to push a project anymore.
The most current attempt was going back to my original GitHub account.
I created a brand new repository.
I created a new folder and copied my simple python project into it and saved.
error: remote origin already exists.
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % git remote rm origin
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % git remote rm upstream
error: No such remote: 'upstream'
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % git remote add origin https://github.com/stephanieBrandon/GuessARandomNumberGame.git
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % git push -u origin main
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/stephanieBrandon/GuessARandomNumberGame.git'
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % ls -a
. .. guess_a_random_number.py
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /Users/stephaniebrandon/Documents/GitHubPortfolio/Python/GuessARandomNumberGame/pythonGame/.git/
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % git remote add origin https://github.com/stephanieBrandon/GuessARandomNumberGame.git
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % git push -u origin main
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/stephanieBrandon/GuessARandomNumberGame.git'
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % ls -a
. .. .git guess_a_random_number.py
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 pythonGame % git status
On branch master
I am hoping there is just some simple thing I am missing, if someone could explain and help me out it would be much appreciated.
Stephanie, your local branch name is "master", not "main" as you can see from the "git status" output.
If you try "git push origin master", it should work.
You dont have branch main, you have branch master. 😊
Try:
git push origin master
You need to have some commits before pushing your repository to Github.
Moreover, your local default branch name is master, so you have to use git push -u origin master instead of git push -u origin main
$ ls
guess_a_random_number.py
$ git init
Initialized empty Git repository in /Users/stephaniebrandon/Documents/GitHubPortfolio/Python/GuessARandomNumberGame/pythonGame/.git/
$ git add .
$ git commit -m "initial commit"
$ git remote add origin https://github.com/stephanieBrandon/GuessARandomNumberGame.git
$ git push -u origin master # not main

git cannot push to existing repo

I have a GitHub repo energys_arduino_max485_mqtt_autoconnect_ec400, but I have problem in push the file to this repo
(base) Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git remote add origin https://github.com/SamuelXiot/energys_arduino_max485_mqtt_autoconnect_ec400.git
error: remote origin already exists.
(base) Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git branch -M main
(base) Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git push -u origin main
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/SamuelXiot/energys_arduino_max485_mqtt_autoconnect_ec400.git.'
(base) Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git remote remove origin
(base) Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git remote add origin https://github.com/SamuelXiot/energys_arduino_max485_mqtt_autoconnect_ec400.git
(base) Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git branch -M main
(base) esp32#Arthurs-Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git push -u origin main
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/SamuelXiot/energys_arduino_max485_mqtt_autoconnect_ec400.git'
(base) Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/SamuelXiot/energys_arduino_max485_mqtt_autoconnect_ec400.git'
(base) Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git pull --rebase
remote: Repository not found.
fatal: repository 'https://github.com/SamuelXiot/energys_arduino_max485_mqtt_autoconnect_ec400.git/' not found
(base) Mac-Pro energys_arduino_max485_mqtt_autoconnect_ec400 % git push
error: src refspec refs/heads/main does not match any
error: failed to push some refs to 'https://github.com/SamuelXiot/energys_arduino_max485_mqtt_autoconnect_ec400.git'
why I cannot push to GitHub??
It seems like you're trying to upload all of your code at once to the empty repo you've made on github's site. It also seems you've already run git init
You need to first commit all of your changes with git add . then git commit -m "comment you choose" so that you have something to push. It's possible that you've made a new branch, you don't need a branch in this situation.
git add .
git commit -m "first commit"
git remote add origin https://github.com/user/repo.git
git push
Finally found the solution, I need to update the GitHub account in Mac first.
Need to delete all account credential
$ git credential-osxkeychain erase
host=github.com
protocol=https
> [Press Return]
create a PAT
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
then update the git login in terminal
(base) -Mac-Pro 485_mqtt_autoconnect % git push origin
Username for 'https://github.com': SamuelXiot
Password for 'https://SamuelXiot#github.com':
Enumerating objects: 18, done.
Counting objects: 100% (18/18), done.
Delta compression using up to 8 threads
Compressing objects: 100% (12/12), done.
Writing objects: 100% (18/18), 3.22 KiB | 1.07 MiB/s, done.
Total 18 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To https://github.com/SamuelXiot/485_mqtt_autoconnect.git
[new branch] master -> master
(base) -Mac-Pro 485_mqtt_autoconnect %
then normal again.
thanks all for the help.

Jenkins github username password login

I have installed Jenkins ver. 1.653 on OSX 10.11.3 using standard installer and added git plugin. I tried to create job for public project from github and it works. Now I am trying to create job for private repo using username and password but it always fails. This is log:
Started by user anonymous
Building in workspace /Users/Shared/Jenkins/Home/workspace/MyProject
git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git config remote.origin.url https://github.com/myproject/myproject-android.git # timeout=10
Fetching upstream changes from https://github.com/myproject/myproject-android.git
git --version # timeout=10
using .gitcredentials to set credentials
git config --local credential.username vandzi # timeout=10
git config --local credential.helper store --file=/Users/Shared/Jenkins/tmp/git428140271294555744.credentials # timeout=10
git -c core.askpass=true fetch --tags --progress https://github.com/myproject/myproject-android.git +refs/heads/:refs/remotes/origin/
ERROR: Timeout after 10 minutes
git config --local --remove-section credential # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/myproject/myproject-android.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:766)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1022)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1053)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress https://github.com/myproject/myproject-android.git +refs/heads/:refs/remotes/origin/" returned status code 143:
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:764)
... 11 more
ERROR: null
Finished: FAILURE
Any idea what can be problem?
Also had ERROR: null in the end, for me it was timeout issue. You can increase timeout for cloning and checkout like this:
Go to job configuration and find git section
Add -> Advanced clone behaviours. There you can specify timeout and check 'shallow copy' (which is faster)
Add -> Advanced checkout behaviours. You can set time out for checkout.

mercurial-server pretxncommit hook not working

Server
$ hg --version
Mercurial Distributed SCM (version 2.0.2)
/usr/share/mercurial-server$ cat mercurial_server-1.1.egg-info
Metadata-Version: 1.1
Name: mercurial-server
Version: 1.1
$ cat /etc/mercurial-server/remote-hgrc.d/check.rc
[ui]
debug = true
[hooks]
commit.h1 = echo "executing commit USER:$REMOTE_USER"
precommit.h2 = echo "executing precommit USER:$REMOTE_USER"
pretxncommit.h3 = echo "executing pretxncommit USER:$REMOTE_USER"
pretxnchangegroup.h4 = echo "executing pretxnchangegroup USER:$REMOTE_USER"
local machine
unity#unity:~/hgtst/hgadmin$ vi keys/users/user.m/user.m.pub
unity#unity:~/hgtst/hgadmin$ hg commit -m "Test L"
unity#unity:~/hgtst/hgadmin$ hg push
pushing to ssh://hg#repo/hgadmin
searching for changes
remote: adding changesets
remote: changesets: 1 chunks
remote: add changeset 9cb298911d0c
remote: adding manifests
remote: manifests: 1/1 chunks (100.00%)
remote: adding file changes
remote: adding keys/users/user.m/user.m.pub revisions
remote: files: 1/1 chunks (100.00%)
remote: added 1 changesets with 1 changes to 1 files
remote: calling hook pretxnchangegroup.access: mercurialserver.access.hook
remote: running hook pretxnchangegroup.h4: echo "executing pretxnchangegroup USER:$REMOTE_USER"
remote: executing pretxnchangegroup USER:
remote: updating the branch cache
remote: calling hook changegroup.aaaaa_servelog: mercurialserver.servelog.hook
remote: running hook changegroup.aaaab_update: hg update -C default > /dev/null
remote: running hook changegroup.aaaac_purge: hg purge --all > /dev/null
remote: calling hook changegroup.refreshauth: mercurialserver.refreshauth.hook
unity#unity:~/hgtst/hgadmin$
when I push some changes from local machine to the mercurial-server via ssh pretxnchangegroup hook is executed but no other hook is getting executed.
This is to be expected.
You don't commit at the remote server, you push changes to it.
That's what changegroup is for, which you are using.
To me it seems like everything is working like it should.
Hope this helps, TW

github file not getting committed

I am new to GitHub, but I have followed the steps to create a repo:
$ mkdir fb
$ cd fb
$ git init
$ git add README
$ git commit -m 'first commit'
$ git push origin master
Now when I try to make my first commit, I get the follwowing error:
$ git push origin master
error: Cannot access URL https://github.com/xxx/yyy/, return code 60
error: failed to push some refs to 'https://github.com/xxx/yyy'
I am using the latest git version. Why does GitHub throw this unusal error and how do I fix it?
What if you try using the SSH protocol for the git repository, e.g. git#github.com:xxx/yyy.git, and see if that works for you?
$ git remote rm origin
$ git remote add origin git#github.com:xxx/yyy.git
I believe that return error code has something to do with the SSL Certificate... I'm sorry I cannot help further.