Pushing to Git returning Error Code 403 fatal: HTTP request failed

后端 未结 30 1659
轻奢々
轻奢々 2020-11-22 04:52

I was able to clone a copy of this repo over HTTPS authenticated. I\'ve made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7 x64.

30条回答
  •  温柔的废话
    2020-11-22 05:18

    None of the above answers worked for my enterprise GitHub account. Follow these steps for pushing via ssh key generation way.

    Create a repo by visiting your git account.

    Generate ssh key:

    ssh-keygen -t rsa -C "your_email@example.com"
    

    Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

    ssh -T git@github.com
    clone the repo:
    git clone git://github.com/username/your-repository
    

    Now cd to your git clone folder and do:

    git remote set-url origin git@github.com:username/your-repository.git
    

    Now try editing a file (try the README) and then do:

    git add -A
    git commit -am "my update msg"
    git push -u origin master
    

    Update: new git version seems to recommend not to have any file while new repo is created. Hence make aa blank repo.

提交回复
热议问题