Modify config in Git folder under current project
1) Edit the. Git/config file
2) Find the URL variable under [remote “origin”]
3) Modify URL= https://github.com/user/test.git , modify to URL= ssh://git @Github.com/user/test.git, save after modification
4) Synchronization through git push origin master is successful
Amend as follows:
[root@localhost learngit_2]# cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = ssh://[email protected]/shengleqi/gitskills.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master
Successful execution:
[root@localhost learngit_2]# git push -u origin master The authenticity of host 'github.com (192.30.255.112)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)?yes Warning: Permanently added 'github.com,192.30.255.112' (RSA) to the list of known hosts. Counting objects: 26, done. Compressing objects: 100% (19/19), done. Writing objects: 100% (26/26), 2.08 KiB, done. Total 26 (delta 6), reused 0 (delta 0) remote: Resolving deltas: 100% (6/6), done. To ssh://[email protected]/shengleqi/gitskills.git * [new branch] master -> master Branch master set up to track remote branch master from origin.
Read More:
- push failed The requested URL returned error: 403
- Git error: the requested URL returned error: 500
- GitHub push ErrorThe requested URL returned error: 403 Forbidden while accessing
- How to Solve Error: The requested URL returned error: 401 Unauthorized while accessing
- Solving GitHub push error: the requested URL returned error:403 Forbidden while accessing
- Girl: RPC failed; HTTP 411 curl 22 the requested URL returned error: 411 length required:
- Error: RPC failed; HTTP 504 curl 22 the requested URL returned error: 504 gateway time out
- Error in brew install: curl: (22) the requested URL returned error: 404 Not Found
- curl: (22) The requested URL returned error: 404 Not Found Server does not provide clone.bundle; ig
- Error: No such keg: /usr/local/Cellar/node&install nvm&brew installation&Oh my zsh.git installation&git set alias&No bundle URL prese
- Error: no such keg: / usr / local / cellular / node & install NVM & Brew install & oh my Zsh. Git install & git set alias & no bundle URL press
- [Git] git pull pull remote git push to remote git commit submit reject
- Git error prompt: fatal: not a git repository (or any of the parent directories):. Git
- Error report after solving git push origin master
- Browser prompt: Source mapping error: request failed with status 404 Source URL: http://xxx.js Source mapping URL: jquery.min.map
- Win10 installation git click git bash flash back problem solution
- How to solve error: failed to push some refs to ‘[email protected]:……git pull conflict
- How to Fix GIT Push Error
- Git failed to submit data error: failed to push some refs to’https://github.com/XXXXXXX/gif.git’
- pathspec ‘master’ did not match any files known to git