Linux shell提交github安装以及使用
2016-06-16 22:12
411 查看
•安装 yum install git git config //git配置修改 •Linux中创建pub key,导入github • git init 创建新项目并上传(或者git clone) • 建立新文件, git add • git commit • git push
两项基本配置:
#配置使用 git仓库的人员姓名 git config --globaluser.name “Mike" #配置使用 git仓库的人员email git config --global user.emailyou@xyz.com
本地无项目是这样操作(与clone有点区别):
# 初始化一个版本仓库 git init cd existing_folder git init git remote add origin git@DX2:kennethxian/testproject.git //remote add重命名指令 git add . git commit git push -u origin master
遇到的错误以及解决办法:
[root@HTY-1 SortedPriceName]# git push To git@github.com:crazyyanchao/SortedNmaePrice.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:crazyyanchao/SortedNmaePrice.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.
以上报错通过更新本地仓库解决,之后重新提交ok!
[root@HTY-1 SortedPriceName]# git pull origin You asked to pull from the remote 'origin', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line. [root@HTY-1 SortedPriceName]# git pull origin master From github.com:crazyyanchao/SortedNmaePrice * branch master -> FETCH_HEAD Merge made by recursive. README.md | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) create mode 100644 README.md
相关文章推荐
- android wifi 无线调试
- RPC failed; result=22, HTTP code = 411
- 查看github pages文档的方式
- 使用BAE的基于Web.py的简单博客程序
- git更新已經刪除的文件
- 运维入门
- 动态清空 nohup 输出文件
- install scrapy with pip and easy_install
- 提取Git每次提交后Commit的文件
- GIT迁移服务器
- 分布式版本管理git入门指南使用资料汇总及文章推荐
- Linux Shell常用技巧
- Shell 脚本编程陷阱
- Linux Shell - 如何使用sort与uniq命令删除重复的文本行
- git终极指南:在实际开发中的应用
- shell字符串操作详解
- Shell中删除某些文件外所有文件的3个方法
- Ruby中执行Linux shell命令的六种方法详解
- VB使用shell函数打开外部exe程序的实现方法