git的使用

github的使用

一.branch的创建与合并

https://guides.github.com/activities/hello-world/

二.代码提交

参考文档:http://www.cnblogs.com/cxk1995/p/5800196.html

  1. 克隆项目到本地
    https://github.com/CKTim/BlueTooth.git替换成你之前复制的地址
#git clone https://github.com/CKTim/BlueTooth.git
  1. 这个步骤以后你的本地项目文件夹下面就会多出个文件夹,该文件夹名即为你github上面的项目名,如图我多出了个Test文件夹,我们把本地项目文件夹下的所有文件(除了新多出的那个文件夹不用),其余都复制到那个新多出的文件夹下
  2. 进入项目目录
# cd Test
  1. 别忘记后面的.,此操作是把Test文件夹下面的文件都添加进来
# git add .   
  1. “提交信息”里面换成你需要,如“first commit”
git commit  -m  "提交信息"
  1. 把本地仓库push到github上面,此步骤需要你输入帐号和密码
git push -u origin master 

三.内容修改后的操作

git的下载:https://git-scm.com/downloads

$ git add .
warning: LF will be replaced by CRLF in controller/admin-openrc.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in controller/all_floating_ip_id.txt.
......省略一堆内容
$ git commit -m 'controller'
[master 8c8edb3] controller
 54 files changed, 0 insertions(+), 0 deletions(-)
 rename README.md => controller/README.md (100%)
 rename admin-openrc => controller/admin-openrc (100%)
 rename all_floating_ip_id.txt => controller/all_floating_ip_id.txt (100%)
 rename all_network_id.txt => controller/all_network_id.txt (100%)
 rename all_router_id.txt => controller/all_router_id.txt (100%)
 rename all_server_id.txt => controller/all_server_id.txt (100%)
......省略一堆内容
$ git push -u origin master
Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1/1), done.
Writing objects: 100% (2/2), 240 bytes | 0 bytes/s, done.
Total 2 (delta 0), reused 0 (delta 0)
To https://github.com/tom523/openstack_install.git
   ce53904..8c8edb3  master -> master
Branch master set up to track remote branch master from origin.

GitHub 实现多人协同提交代码并且权限分组管

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Git和Github学习 1.创建版本库 安装git,至于这个话题就不细说了,按照你电脑的操作系统下载一个合适的g...
    郭子web阅读 392评论 0 0
  • Git的使用 首先登录https://git.oschina.net,如没有账号进行注册. Git简单介绍 Git...
    Sunney阅读 687评论 0 2
  • 杨明智阅读 199评论 0 0
  • 9月1日,开学的第一天,我观看了《开学第一课》,其中最让我感动的就是那个痴迷于中国汉字的外国叔叔理查德-西尔斯。网...
    牛广宇阅读 234评论 0 0