手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

github入门教程及日常使用操作命令

[日期:2012-11-05] 来源:Linux社区  作者:fovwin [字体:大 中 小]

From github.com:mintist/JFF-RTOS
* branch            master    -> FETCH_HEAD
Merge made by the 'recursive' strategy.
.gitignore |  12 ++++++++++++
README.md  |    4 ++++
2 files changed, 16 insertions(+)
create mode 100644 .gitignore
create mode 100644 README.md

注意:那就是github自动帮你生成的两个文件,先拉(pull)下来先~~~
 
否则~~~也没事,往后走先~~~

$git init //初始化 

Initialized empty Git repository in /home/mintist/github_JFF-RTOS/.git/

  1. $git add . //把所有文件加入到索引(不想把所有文件加入,可以用gitignore或add 具体文件,见下文)
  2. $git commit -m "好吧,这还算不上一个RTOS~~~"//提交到本地仓库,然后会填写更新日志

4 files changed, 259 insertions(+)
 create mode 100644 Readme
 create mode 100644 app.c
 create mode 100644 core.c
 create mode 100644 core.h

$git remote add origin git@github.com:mintist/JFF-RTOS.git //增加到remote 

$git push origin master //推(push)到github上 

 

if(you git pull origin master as I say ,you will get )
 Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 2.96 KiB, done.
Total 8 (delta 1), reused 0 (delta 0)
To git@github.com:mintist/JFF-RTOS.git
  c13a550..109de37  master -> master
else
 

To git@github.com:mintist/JFF-RTOS.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:mintist/JFF-RTOS.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details. 如果遇到错误,再拉一下就好了~~
 

还有平常的一些更新啥的请看下文,亲测可用~~~

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款