Skip to content
enlight-tech edited this page Nov 25, 2021 · 11 revisions

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

How i fixed git error?

D:\LearnPython>git init Initialized empty Git repository in D:/LearnPython/.git/

D:\LearnPython>git add helloworld.py

D:\LearnPython>git commit -m "first commit"

[master (root-commit) 06456a1] first commit

1 file changed, 3 insertions(+)

create mode 100644 helloworld.py

D:\LearnPython>git branch -M master

D:\LearnPython>git remote add origin https://github.com/enlight-tech/learnpython.git

D:\LearnPython>git push -u origin master

remote: Permission to enlight-tech/learnpython.git denied to vidyasekaran.

fatal: unable to access 'https://github.com/enlight-tech/learnpython.git/': The requested URL returned error: 403

Solution

Go to Windows Credentials Manager -> Add Generic add below

Internet or network address : git:https://github.com

User name : [email protected]

Password : (Generate Token in github and add it here)

save and close

Push and check it works

D:\LearnPython>git push -u origin master


  1. …or create a new repository on the command line

  2. echo "# learnpython" >> README.md

  3. git init

  4. git add README.md

  5. git commit -m "first commit"

  6. git branch -M main

  7. git remote add origin https://github.com/enlight-tech/learnpython.git

  8. git push -u origin main

  9. …or push an existing repository from the command line

  10. git remote add origin https://github.com/enlight-tech/learnpython.git

  11. git branch -M main

  12. git push -u origin main

Clone this wiki locally