github结合git使用解析
来源:互联网 发布:b2b软件怎么下载 编辑:程序博客网 时间:2024/05/29 03:16
问题1:在terminal中使用git 指令push origin master提示需要输入用户名密码,如何不用每次输入?
答:1)配置git 的用户名和邮箱 (github账户注册的用户名和邮箱)
eg: git config --global user.name “kenventhunder”
git config --global user.email "3127077340_zhq@sina.com"
查看配置信息 git config --global --list
注意:当有多个网站的使用的时候,比如同时使用码云和github要注意每次使用的更改
2)生成ssh 公钥和私钥,公钥私钥用于非对称加密,公钥放置于github网站,私钥放置于本机存储
输入命令 ssh-keygen -t rsa -C "3127077340_zhq@sina.com"
enter后结果如下
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/zss/.ssh/id_rsa): 注意这个地方直接点enter即可,否则输入特定文件名比如githubrsa
默认生成的两个文件 githubras githubras.pub在当前目录下,注意生成的私钥公钥必须放在/Users/zss/.ssh/ 这个目录下(当然zss指的是具体mac用户名),否则git后续指令会提示权限不对
如果接下来提示
/Users/zss/.ssh/id_rsa already exists.
Overwrite (y/n)? 选择y覆盖即可。
3)vim /Users/zss/.ssh/id_ras.pub 拷贝其中的内容到github相应的项目仓库 Settings -> Deploy keys -> Add deploy key,注意勾选下面的write权限
4)然后拷贝项目路径到本地clone即可,注意路径使用 ssh形式的eg: git@github.com:kevinthunder/test.git,不要使用https的。
问题2:项目从github下拉(clone)到了本地,执行命令后报错
问题3:执行push origin master 报错fatal: 'orign' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
可能原因分析:指令错了,比如 pull origin master 输入成了 pull orign master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
上述问题1中2)生成的私钥公钥未放在/Users/your user name/.ssh/ 这个目录下
- github结合git使用解析
- git/github/MyEclipse结合使用
- git 结合github的使用
- IDEA结合shell使用git和github
- git和github的结合使用
- 结合Github使用git管理代码的简便方法
- eclipse结合git和github
- 添加远程库(git结合github)
- GitHub与git结合的界面操作
- idea结合git使用
- Xcode 和github结合使用
- msysgit和github 结合使用
- Github和webstorm结合使用
- Git本地项目上传,版本管理工具与GitHub的简单结合使用
- git使用02 git&&github
- git/github 使用
- git/github 使用
- git/github 使用
- Codeforces Round #417 (Div. 2) C. Sagheer and Nubian Market(二分查找)
- 六款值得推荐的android(安卓)开源框架简介
- Yii框架中MongoDB类似In查询
- 打war包/jar包的方法
- Linux系统下solr服务器的搭建
- github结合git使用解析
- 抛弃恐惧,重新上路
- 蓝桥-ALGO-15-旅行家的预算
- spring事务的传播机制
- JAVA初窥:Future
- 【JAVA】如何编写自己的类加载器
- 这个架构能实现吗?
- com.alibaba.fastjson.JSONException: exepct '[', but {, type : class com.lvche.pocketscore.bean2.Room
- python正则表达式(re)