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閱讀 385評論 0 0
  • Git的使用 首先登錄https://git.oschina.net,如沒有賬號進行注冊. Git簡單介紹 Git...
    Sunney閱讀 669評論 0 2
  • 楊明智閱讀 197評論 0 0
  • 9月1日,開學的第一天,我觀看了《開學第一課》,其中最讓我感動的就是那個癡迷于中國漢字的外國叔叔理查德-西爾斯。網...
    牛廣宇閱讀 209評論 0 0