學習git部署

git的命令:php

配置用戶名:git config  --global user.name '用戶名'html

配置郵箱:git config --global user.email '郵箱號'linux

初始化郵箱:git init 出現隱藏倉庫 一次便可git

查看狀態:git status  屢次驗證github

工做區添加到暫存區:git add 文件名  建立:touch緩存

暫存區到倉庫: git  commit -m 'add 文件名'fetch

修改文件:相似於linux  vi進入  而後cat查看 繼續git add  ;  git commitspa

刪除文件:git rm 文件名命令行

提交描述:git commit -m '描述'     rm 文件名htm

倉庫到遠程倉庫:先下載到本地 git clone 倉庫地址(copy)而後使用命令git push

itcastphpgitl / test 
forked from itcastphpgit2/test 
Pulse 
V 1 branch 
Graphs 
@ Unwatch 
O Settings 
Star 
O 
Fork 
1 
Code 
n Pull requests 0 
— Edit 
(D 9 commits 
Branch: master 
New pull request 
This branch is 2 commits ahead, 1 commit behind itcastphp •master. 
itcastphpgitl 
al. php logo. png php2. php REAWE.md test 3. php 
PR-35 
S touch a2. php 
R35 
s—git add a2. php 
s-git comit -m 
(mas er) 
(mas er) 
(mas er) 
README.md 
al .php 
[31 a2.php 
logo.png 
php2.php 
@ test3.php 
3. 
1 file changed, O insertions(+), O deletions (-) 
create mode 100644 a2. php 
PR-35 (mas er) 
S git push 
. 3, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (2/2), done. 
Writing objects: 100% (3/3), 306 bytes I O bytes/ s, 
Total 3 (delta 1), reused O (delta O) 
To https://github. com/itcastphpgitl/test.git 
3182dOd.. le3532d master master 
done. 
(mas er)

 

我的倉庫建立過程:

倉庫名:用戶名.github.io   index.html(必須.html)靜態網頁

 

訪問:

https://用戶名.github.io

 

SourceTree&Git部分名詞解釋

  1. 克隆(clone):從遠程倉庫URL加載建立一個與遠程倉庫同樣的本地倉庫
  2. 提交(commit):將暫存文件上傳到本地倉庫(咱們在Finder中對本地倉庫作修改後通常都得先提交一次,再推送)
  3. 檢出(checkout):切換不一樣分支
  4. 添加(add):添加文件到緩存區
  5. 移除(remove):移除文件至緩存區
  6. 暫存(git stash):保存工做現場
  7. 重置(reset):回到最近添加(add)/提交(commit)狀態
  8. 合併(merge):將多個同名文件合併爲一個文件,該文件包含多個同名文件的全部內容,相同內容抵消
  9. 抓取(fetch):從遠程倉庫獲取信息並同步至本地倉庫
  10. 拉取(pull):從遠程倉庫獲取信息並同步至本地倉庫,而且自動執行合併(merge)操做,即 pull=fetch+merge
  11. 推送(push):將本地倉庫同步至遠程倉庫,通常推送(push)前先拉取(pull)一次,確保一致
  12. 分支(branch):建立/修改/刪除分枝
  13. 標籤(tag):給項目增添標籤
  14. 工做流(Git Flow):團隊工做時,每一個人建立屬於本身的分枝(branch),肯定無誤後提交到master分枝
  15. 終端(terminal):能夠輸入git命令行
相關文章
相關標籤/搜索