4

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

screenshot of the Git Bash

Asha
  • 805
  • 3
  • 10
  • 18

6 Answers6

3

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.

  1. 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"
  2. 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.
  3. If the url is not setup run git remote set-url origin https://github.com/www-prolificme-com/mahawiki/
  4. Run git remote -v to verify if your url is setup
  5. git add .
  6. git commit -m "your message"
  7. git push origin master
bot
  • 1,293
  • 3
  • 17
  • 34
  • I followed the steps you said,but i'm still getting the same error.why is that? – Asha Mar 05 '19 at 14:56
  • Can you please mention the steps you are following along with the output of `git config --list` command? – bot Mar 05 '19 at 15:08
  • first i cloned the repository, then i executed 'git config --list ' then i saw website link,hence i executed git remote -v ,then git add. then 'git commit -v' and finally executed git push command. but i received the same error – Asha Mar 06 '19 at 16:48
  • Why are you using `git commit -v`? Try `git commit -m "your comment"` and `git push origin branch_name`, you can check branch name with `git branch`. Also, `git remote -v` does not executes anything, it only returns the current repository you are in. – bot Mar 06 '19 at 17:54
  • still receiving the error,i have included the screenshot of the console.can you check the updated of my question.. – Asha Mar 07 '19 at 06:16
  • Are you added as a contributor to the repository you are trying to push? The public repository only give read only access to anonymous users. You cannot push unless you are added as a contributor. – bot Mar 07 '19 at 14:48
1

Remove/Update the saved credentials:

  1. Click Start
  2. Search for 'Credential Manager'
  3. Select 'Windows Credentials Manager' > 'Windows Credentials'
  4. Search for the credentials that you want to remove/update
  5. Click on the credential entry > Click 'Edit' or 'Remove'
0

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

KushKim
  • 16
  • Thank you for the help.i tried but didn't work.i'm getting the same error – Asha Mar 05 '19 at 14:57
  • intersting... first your git local repo to backup another folder and your git folder to delete 1. 'add a new folder' 2. that folder is git folder 'git init' to make git local repo 3. 'git clone https://github.com/www-prolificme-com/mahawiki/' to cloning your folder 4. backup folder to original git folder 5. git add . 6. git commit -m "message" 7. git push – KushKim Mar 06 '19 at 02:19
  • i'm still receiving the error. i have uploaded the screenshot of the console above – Asha Mar 07 '19 at 08:42
  • i think may your permission denied error is github ssh key register error, make one of ssh and add on github account – KushKim Mar 07 '19 at 09:13
0

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
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
sizan
  • 1
0

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.

enter image description here

You select all you need and then push again. It will be pushed successfully.

Abdur Rahman
  • 1,420
  • 1
  • 21
  • 32
0

If nothing working please check if you have checked the below checkboxes while creating token

Personal access tokens

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Saif Ali
  • 1
  • 1