Unable to push local repository to GitHub
Steps followed:
mkdir github-local
cd github-local
git init
touch README.md
git add .
git commit -m "test commit"
git remote add origin git#github.com:sounak-patra/github-local.git
git remote -v
git push --set-upstream origin master
Output:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Create the remote repository first in order to push into that repository. Before trying to add remote repository (step #7) you must create the remote repo.
The error is self explanatory:
ERROR: Repository not found. fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Related
I want to push changes from my local repository to my github repo. I start with the commands giving from github quickstep:
git init
git add .
git commit -m "first commit"
and then
$ git add origin https://github.com/Svein-Tore/forrigling.git
fatal: pathspec 'origin' did not match any files
Any suggestions to what can be wrong?
You've to use git remote add origin https://github.com/Svein-Tore/forrigling.git
When you use git add origin, it tries to add the file 'origin'
I have a repository- 'repo1' in our company's GitHub cloud.
git remote -v, shows -
origin git#github.****:***/repo1.git (fetch)
origin git#github.****:***/repo1.git (push)
Now I am trying to add a new remote repo - 'repo2' with the command line:
projectName=repo2
mkdir $projectName
cd $projectName
git init -b $projectName
touch README.md
git add README.md
git commit -m 'Initial commit'
git remote add origin ****:***/repo2.git
git push -u origin $projectName
and I get an error in the last command:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
It is worth emphasizing that the repo was created with local success.
also, git remote -v, shows
origin git#github.****:***/repo2.git (fetch)
origin git#github.****:***/repo2.git (push)
but failed to push to remote.
also is worth emphasizing, that I could add a new repo in our GitHub site. The only problem occurs when adding from the terminal.
I found on GitHub forums, that the new repo must be created on GitHub site before doing the git push
I have made a react native project on visual studio code. I want to push this project to someone else's git repo.
I did the following:
git remote add origin https://github.com/aasthaverma1212/Android_Project.git
git branch -M main
git push -u origin main
It gave me error that remote: Permission to XXXXXXX/Android_Project.git denied to pXXXXXXXX4. fatal: unable to access 'https://github.com/XXXXXXX/Android_Project.git/': The requested URL returned error: 403
I even tried to do git config --global user.email 'XXXXXXXXXX#gmail.com'
And then again I did git push -u origin main
It still gives me the same error.
I am using Gitbash to commit my project but I am getting the below
error and the repository which I am getting in fatal error is not the
remote repository to which I am doing a commit.
I want to change this repo
$ git push -u origin master
Fatal: HttpRequestException encountered.
Username for 'https://github.com': 4bhishekKasam
remote: Repository not found.
fatal: repository 'https://github.com/4bhishekKasam/Authentication-using-Passportjs.gi/' not found
now I created new repo still i am unable to commit
First, your error is when you want to push your commits to the remote GitHub repo, not when you commit.
You are able to commit: it is a local operation which does not care about the remote repo.
But try:
cd /path/to/local/repo
git remote set-url origin https://github.com/4bhishekKasam/Passportjs.git
(or git remote add origin ..., if you didn't set origin before)
Then your git push -u origin master will work.
I'm trying to follow instruction found here, but it fails on the very first step:
C:\wxFork [master +42 ~0 -32 !]> git fetch upstream
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What do I do?
Thank you.
You need to add your upstream first by adding it explicitly to your list of remotes:
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
Doing a git remote -v should show your upstream and now the git fetch upstream should work for you