window端GitHub托管代码
来源:互联网 发布:火山软件开发平台 编辑:程序博客网 时间:2024/06/06 01:51
一些前期配置见博客点击打开链接
1、下载GitHub的bash和Windows desk版本,在用户目录下生成自己的公钥.pub
cd ~
ssh-keygen -t rsa
一直enter
2、把用户公钥粘贴GitHub网站的ssh key那,下次免密上传
https://www.zhihu.com/question/21402411
3
第一次进入时:echo "# f2fsCode" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:xixiss/f2fsCode.git
git push -u origin master
以后每次提交:
git add 文件名
git commit -m "修改描述"
git push
4、git的客户端和网页端都能查看最近的更改。客户端还能回滚
使用遇到的问题
$ git push
To github.com:xixiss/f2fsCode.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:xixiss/f2fsCode.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
To github.com:xixiss/f2fsCode.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:xixiss/f2fsCode.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
这是因为local版本和远端版本不一致造成的(不一致的原因是再客户端和bash两个地方同时更改,造成了版本不一致),需要同过git pull 操作,拉取远程代码,使得版本同步,才能继续push
所以在协同操作时,每次操作要确保自己写的local版本与remote版本一致:写之前先pull一次!!!!
这样,每次编辑之前,都是最新版本,协同操作也变成了版本的迭代,就像一个人在一直提交一样(一个人不用pull的原因是,每次他写好的代码,push上去之后,没有别人去改,于是本地和远端代码一直一致,因此不用pull)
阅读全文
0 0
- window端GitHub托管代码
- 使用GitHub托管代码
- 使用GitHub托管代码
- GitHub托管代码
- GitHub 托管代码
- 使用GitHub托管代码
- GitHub 代码托管(1)
- GitHub 代码托管(2)
- GitHub代码托管(3)
- 【代码托管】Github 使用
- github代码托管(Mac)
- GitHub托管代码
- github 代码托管
- GitHub托管代码
- Github简单代码托管
- GitHub托管代码
- 使用GitHub托管代码
- GitHub托管代码
- 图文讲解jQuery属性的样式
- lnmp 环境下安装 mysql 显示无法写入pid文件
- C# Dictionary 的几种遍历方法
- 异常处理
- java中,一个类实现某个接口,必须重写接口中的所有方法吗?
- window端GitHub托管代码
- MT 198 Proprietary Message专用电文
- LeetCode 算法习题 第四周
- selenium浏览器驱动下载
- 原码,反码,补码的理解
- Equals 和 == 的区别
- JAVA文件工具类之——文件删除(所有空目录、当前目录中所有目录文件、目录下所有文件)
- Java I/O操作
- 数据挖掘算法(三)--logistic回归