zhaopingxi 9 mesi fa
parent
commit
aa9c779dae
1 ha cambiato i file con 75 aggiunte e 46 eliminazioni
  1. 75 46
      README.md

+ 75 - 46
README.md

@@ -4,76 +4,105 @@ git-help
 Git简单使用说明
 
 
-##初步
+## 初步
 
-    git init
-    git remote add origin http://url.git
-    git commit -m "import"
-    git push -u origin master
+**新仓库**,初始化
 
-###签出代码库
+```shell
+git init
+git remote add origin http://url.git
+git commit -m "import"
+git push -u origin master
+```
 
-    git clone http://url.git dirName
-    git checkout origin
-    git commit -m "modify"
-    git push
+**已有仓库**,添加远程
 
-##分支
-###创建分支
+```shell
+git remote add third http://url.git
+git push -u third master
+git commit -m "update"
+git push
+```
 
-    git branch branchName
-    git branch -m <old_name> <new_name> 改名字 (如果有同名會失敗,改用 -M 可以強制覆蓋)
+### 签出代码库
 
-###切换分支
+```shell
+git clone http://url.git dirName
+git checkout origin
+git commit -m "modify"
+git push
+```
 
-    git checkout branchName
-    
-> 注意:如果你有檔案修改了卻還沒 commit,會不能切換 branch
+## 分支
+### 创建分支
 
-    git checkout -b <new_branch_name> (<from_branch_name>) 本地建立 branch 並立即 checkout 切換過去
+```shell
+git branch branchName
+git branch -m <old_name> <new_name> 改名字 (如果有同名會失敗,改用 -M 可以強制覆蓋)
+```
 
-    
-###删除分支
+### 切换分支
 
-删除远程分支
+```shell
+git checkout branchName
+```
 
-    git push origin --delete <branchName>
+> 注意:如果你有檔案修改了卻還沒 commit,會不能切換 branch
+
+```shell
+git checkout -b <new_branch_name> (<from_branch_name>) 本地建立 branch 並立即 checkout 切換過去
+```
     
-    git branch -d -r branchname 删除远程branchname分支
+### 删除分支
+
+删除远程分支
 
-    git push origin :branch-name 推送一个空分支到远程分支,其实就相当于删除远程分支
+```shell
+git push origin --delete <branchName>    
+git branch -d -r branchname 删除远程branchname分支
+git push origin :branch-name 推送一个空分支到远程分支,其实就相当于删除远程分支
+```
 
-##Tag
+## 标签版本(Tag
 
 显示本地Tag
+```shell
+git tag
+```
 
-    git tag
- 
 - 0.6.7
 - 0.6.8
 - 0.8.0
 
-###添加tag
+### 添加tag
 
-    git tag '0.8.0'
-    git tag -a 0.8.0 -m "comment"
-    
-###推送Tag到远程
+```shell
+git tag '0.8.0'
+git tag -a 0.8.0 -m "comment"
+```
 
-    git push --tag
+### 推送Tag到远程
 
-###删除本地tag
+```shell
+git push --tag
+```
 
-    git tag -d 0.8.0
-    
-    Deleted tag '0.8.0' (was 126095d)
+### 删除本地tag
 
-###删除远程tag
 
-    git push origin --delete tag <tagname>
-    
-    git push origin :refs/tags/0.8.0  推送一个空tag到远程tag
-    
-    remote: Updating references: 100% (1/1)
-    To http://zhenqin-pro102/git/katta.git
-    - [deleted]         0.8.0
+```shell
+git tag -d 0.8.0
+```
+
+Deleted tag '0.8.0' (was 126095d)
+
+### 删除远程tag
+
+```shell
+git push origin --delete tag <tagname>
+git push origin :refs/tags/0.8.0  #推送一个空tag到远程tag
+
+remote: Updating references: 100% (1/1)
+To http://zhenqin-pro102/git/katta.git
+- [deleted]         0.8.0
+```