Chinaunix首页 | 论坛 | 博客
  • 博客访问: 496522
  • 博文数量: 138
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 716
  • 用 户 组: 普通用户
  • 注册时间: 2015-03-03 21:48
文章分类

全部博文(138)

文章存档

2019年(1)

2017年(5)

2016年(99)

2015年(33)

我的朋友

分类: LINUX

2016-08-10 22:26:08

常用命令


1.初始化本地库
git init
2.添加文件到本地库 (例如 hello.c 前提保证文件已经存在)
git add hello.c
3.提交到本地库
    1)git commit -m “first commit” // 提交并添加备注
    2)git commit  -a    //自动更新变化文件
两种方法都可以
4.创建远程库别名 
git remote add origin git@github.com:bulabula001/Project.git
其中 origin是 git@github.com:bulabula001/Project.git 的别名
4.同步远程github库到本地库
git pull  origin master
5.同步本地库到远程库
git push -u origin master




新建仓库的提示


在git上新建git仓库的时候,会有以下提示,比如我新建了 static_detect.git时候会提示有以下帮助信息,如何去运行。


echo "# static_detect" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:bulabula001/static_detect.git
git push -u origin master

阅读(1674) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

j_cle2016-08-10 23:18:31

在Linux环境下,要迅速上传资料到github上,按照以上步骤实现即可。