Unable to commit my project to github - github

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.

Related

Not able to add remote repository

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'

GitHub - failed to create remote repository

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

Cannot update sourcecode from remote repository to local repository

I try to update source code from remote repository to local repository by git command:
$git pull origin dev
The terminal has noticed:
From https://github.com/AAA/BBB
* branch dev -> FETCH_HEAD
Already up to date.
But the source code was not updated.
How can I solve this problem?
Have you tried confirming the git remote -v and see if it points to the right origin ?
Otherwise set the remote origin by
git remote set-url origin <remote-repo-url>

Unable to push files in git repository

I am trying to push my files using git bash to online git repository using this command.
$ git push -u origin master https://github.com/SMAmmar/git-test.git
But after using it i am getting this error
fatal: invalid refspec 'https://github.com/SMAmmar/git-test.git'
How can I solve this problem? I am a newbie when using github so please elaborate what you guys are telling me to do.
From git push
git push <repository> [<refspec>…]
The "remote" repository that is destination of a push operation.
This parameter can be either a URL (see the section GIT URLS below) or the name of a remote (see the section REMOTES below).
So yes, git push can take a URL
But the order is important:
where you push (the URL or remote name)
what you push
In your case:
git push -u origin master
git push -u https://github.com/SMAmmar/git-test.git master
But not both origin and https://github.com/SMAmmar/git-test.git
The first form is preferred. Once that first command is working, a simple git push will be enough.
git push doesn't take a URL. Instead it takes the name of a remote repository that you've previously set up, that's origin, and a branch to push. origin is automatically set up when you git clone a repository.
If you run git remote -v you should see something like this:
origin https://github.com/SMAmmar/git-test.git (fetch)
origin https://github.com/SMAmmar/git-test.git (push)
If you see some other URL, use git remote set-url origin https://github.com/SMAmmar/git-test.git to make origin point at that URL.
Then git push origin master says to push your master branch to the master branch on the repository identified by origin which is https://github.com/SMAmmar/git-test.git.
See also
Working With Remotes
Managing Remote Repositories

Unable to push local repository to GitHub

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.