Cannot push from git - github

When I am using git push, it shows
remote: You must verify your email address.
remote: See https://github.com/settings/emails.
fatal: unable to access 'https://github.com/mynickname/reponame.git/': The requested URL returned error: 403
But I already verified my email address.
On the other hand, I can pull and add, only push is not available. I can also push by using Github Desktop.
Could someone help me? Many thanks

Most likely your git configuration is using a different email address from what you verified. Check that git config user.email outputs the same email that you used on GitHub. If it does not, set it with git config user.email "correct#email.com", then try pushing again.

There is an osxkeychain in Mac, we can delete account information by using
git config --local --unset credential.helper
git config --global --unset credential.helper
sudo git config --system --unset credential.helper
Just asked GitHub Support, the official solution: https://help.github.com/articles/updating-credentials-from-the-osx-keychain/

I have a same problem as you and I can not solve it.
But there is a second way to push you commits.
$ git remote set-url origin git#github.com:bitfish-xyz/viewport.git
$ git pull -u origin master
Use SSH instead of HTTPS.
This work fine for me. If I can solve this directly, I will update this answer.

Related

How to resolve "fatal: unable to access " error

I'm a beginner to GitHub.I need to send a pull request to the master branch.
when i typed the code
git push origin master
It gives me the error
fatal: unable to access
'https://github.com/www-prolificme-com/mahawiki/': The requested URL
returned error: 403
Updated
You mentioned you are trying to pull from git but the command is git push. Anyways, most probably you are getting this error because your repo url is not set locally.
If this is the first time you are sending git request from your system, you might want to setup your username by git config --global user.name "John Doe"
If you have already used git on your system, try checking the git configuration on your system using git config --list command to check whether your repo URL is setup or not.
If the url is not setup run git remote set-url origin https://github.com/www-prolificme-com/mahawiki/
Run git remote -v to verify if your url is setup
git add .
git commit -m "your message"
git push origin master
Remove/Update the saved credentials:
Click Start
Search for 'Credential Manager'
Select 'Windows Credentials Manager' > 'Windows Credentials'
Search for the credentials that you want to remove/update
Click on the credential entry > Click 'Edit' or 'Remove'
your repo is not setting locally
so, you seemed crash message
first
git config --list
to showing your git repo set list
and
git remote set-url origin <your git repo address>
to access git repo and git add . to add your files to git container
git commit -m "your git commit message"
this is your git commit message version or anything possible
git push origin master
finally your files pushing on git repo
it's done!
try it
I got this same problem then I try to this below command.
step 1:
git config --global user.email "user email"
step 2:
git config --global user.name "user name"
After running those commands, you can use this command to push your code:
git push origin master
Even if you set all credentials and other setups in the local machine, you might face this problem.
Currently, GitHub uses 'personal access token' so when or after creating personal access token you must check the Select scopes.
You select all you need and then push again.
It will be pushed successfully.
If nothing working please check if you have checked the below checkboxes while creating token

Cannot push to my repo on github inspite of correct username and email in git config

git config shows correct user name and email and yet I cannot ever git push to my own repo on GitHub. It always says some old username that was used
git config user.name mqshaikh8
git config user.email mqshaikh8#gmail.com
git push origin master
remote: Permission to mqshaikh8/amigo.git denied to kshaikh99.
fatal: unable to access 'https://github.com/mqshaikh8/amigo.git/': The requested URL returned error: 403
git remote --v
origin https://github.com/mqshaikh8/amigo.git (fetch)
origin https://github.com/mqshaikh8/amigo.git (push)
It happened to me quite a bit, mostly after a typo in my password and couldn't ever type a password again.
Usually installing git bash again over the old installation fixes the problem.
If you're using the default settings/windows credentials the please see this github issue on git for desktop to help you on this matter.
This SO post on how to remove git credentials might also help.
Finally what worked is the following:
I was logged into windows as kshaikh99. Since git integrated with windows credential manager, it had cached the kshaikh99 username and password and regardless of what's in git config user.name and user.email, it always used that credential to authenticate and that's why it was failing.
I just signed off and signed into windows as mqshaikh8. Then when I tried to git push origin master, I got a windows credential dialog box to enter my mqshaikh8 username and password. I entered that and it works with no issues.

Git Bash still pushing with previous username

So, I am attempting to push a repository to Github using Git bash. The thing is, it still thinks that I am using a username that I was previously using. However, I changed this username and I checked to be sure with the following commands:
git config user.name
"CorrectName"
git config user.email
"CorrectEmail#correctdomain"
git config --global user.name
"CorrectName
git config --global user.email
"CorrectEmail#correctdomain"
However, Github is still using my previous user name to push the repo. This is evident by the command to push:
git push origin master
remote: Permission to CorrectName/CorrectRepo.git denied to PreviousUsername
fatal: unable to access 'https://github.com/CorrectName/CorrectRepo/': The requested URL
returned error: 403
What can I do in order to successfully push my repo?
Try removing you remote and re additing it.
git remote rm origin
git remote add origin <your origin url>
Ok, I got it to work. Someone helped me and advised me to run a
git config --local credential.helper "" command in my project directory and also a git config --global --unset credential.helper command. It seems like the credentials were still being stored somehow, but git asked for a username and password before pushing after unsetting the credential helper and the push was successful.
Remove your user settings:
Name:
$ git config --global --unset user.name
Email:
$ git config --global --unset user.email
or all your global settings:
$ git config --global --unset-all
Then set your username in git.
To check who you are:
$ git config --list

Error commiting files to GitHub

Whenever I try to commit a file to github i get the following error:
vanes#vanessaddiniz MINGW64 ~/HTML-CSS-and-JS---coursera/site (master)
$ git commit -m "Homepage"
*** Please tell me who you are.
Run
git config --global user.email "you#example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'vanes#vanessaddiniz.(none)')
This is the frst time I try to do this. I've just started a course on coursera and I did everything exactly as done in the video and everythig was going fine until now. How do i fix this? Anyone who can help me, thanks in advance!
P.S: I'm using Windows.
Git always requires an identification while making a commit to a repository. The identification it uses is either your name or email address. This will be used to show commits which belong to users in Git history. The above output already shows you what you need to do. Run the below commands with your name and email address filled.
git config --global user.email "Your email"
git config --global user.name "Your Name"
After this you should be able to commit to git.

problem in pushing to github

I have created a repository on github named pygame. Created a clone and added files and commited.but when I attempt to push I receive the following error:
git push -u origin master
error: The requested URL returned error: 403 while accessing https://github.com/amalapk/pygame/info/refs
fatal: HTTP request failed
I can ssh to git#github.com and receive the notice that I logged in successfully, but can't push to my repository.
I recently experienced this problem when setting up a new clone of my github project.
You need to include your username in the URL to your project, in the form
https://user#github.com/project/...
For example, the URL provided for my test github is this:
https://github.com/jdblair/test.git
If I add my username to it, like this, then I'm able to push and pull from github with no problem:
https://jdblair#github.com/jdblair/test.git
It is easiest to use the URL that contains the username starting from when you clone a project.
You can change the URL for an existing project like this:
git remote set-url origin https://user#github.com/project/foo/bar.git
You can use the ssh authentication instead if you want, but that's a separate setup process.
Github now is asking us to use git 1.7.10 or later:
https://help.github.com/articles/error-the-requested-url-returned-error-403
The GitHub Remote page mentions the read/write addresses for a repo:
Make sure your clone address is like:
https://github.com/username/yourRepo.git
And that you have defined:
git config --global user.name "Firstname Lastname"
git config --global user.email "your_email#youremail.com"
Should you use a git address (without ssh), you would also need:
git config --global github.user username
git config --global github.token 0123456789yourf0123456789token # no longer needed
(with your token coming from “Account Settings” > Click “Account Admin.”)
Update 2013: you still can generate a token (see "Creating an access token for command-line use"), but you would use it as a password for https url.
Actually, if you activate the 2FA (two-factor authentication) mechanism on GitHub, you will need a token for your https url (because your regular password would trigger the second-step verification).
See "Configure Git clients, like GitHub for Windows, to not ask for authentication"
See more at "Which remote URL should I use?".
It's all in the remote.
Change your current remote from https://github.com/amalapk/pygame.git to git#github.com:amalapk/pygame.git and enjoy.
To do this... (assuming your current remote is called origin)
git remote set-url origin git#github.com:amalapk/pygame.git
In my case getting rid of such error message was resolved this way:
Person was simply added to github repository as a colaborator.
Thats it - error vanished magically.
Committing to github from server this is what worked for me in the terminal or git bash
To create a remote to github.com try:
git remote add origin https://put your username here#github.com/put your git username here/put your repository name here
To change the remote just do:
git remote set-url origin https://put your username here#github.com/put your git username here/the name of your repository here
Please follow the instructions on http://help.github.com/create-a-repo/
You have cloned your repository with the public read only url.
RTFM