git免密码输入远程提交(ssh替换https)

一:首先查看是否本项目初始化了git

git remote -v 

不出意外你将会看到类似如下

origin https://github.com/rubenYuan/demo.git (fetch)
origin https://github.com/rubenYuan/demo.git (push)

二:ssh替换https
2.1、移除原有的依赖

git remote rm origin

2.2、新增现在的ssh依赖

git remote add origin git@github.com:rubenYuan/xxx.git

2.3、提交

git push origin master

完!

上一篇:git常见命令
下一篇:git回滚提交

猜你喜欢

转载自blog.csdn.net/ruben95001/article/details/80751216