一、下載代碼

  • 克隆 codegit 應用代碼

 # git clone https://git.sinacloud.com/codegit 
Cloning into 'codegit'...
Username for 'https://git.sinacloud.com':                        輸入您的安全郵箱
Password for 'https://git@sinacloud.com@git.sinacloud.com':        輸入您的安全密碼
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
Checking connectivity... done


  • 查看當前所有版本號

 # cd codegit
 # git branch -a 
  3
* 5
  remotes/origin/3
  remotes/origin/5
  remotes/origin/HEAD -> origin/5


可以看到,兩個版本號,3 和 5。 當前 在版本號 5 下面


  • 切換版本號

 # git checkout 3
Switched to branch '3'
 # git branch -a
* 3
  5
  remotes/origin/3
  remotes/origin/5
  remotes/origin/HEAD -> origin/5



切換到 版本號 3 下面



一、上傳代碼


創(chuàng)建新版本號 8

 # git branch -a
* 3
  5
  remotes/origin/3
  remotes/origin/5
  remotes/origin/HEAD -> origin/5
 # git checkout -b 8      # 創(chuàng)建版本號 8 
Switched to a new branch '8'


修改代碼

 # echo "code 8" > index.php
 # git add index.php
 # git commit -m "code 8"
[8 2d3718a] code 8
 1 file changed, 1 insertion(+), 4 deletions(-)



提交代碼

 # git push origin 8
Username for 'https://git.sinacloud.com':                # 輸入您的 安全郵箱
Password for 'https://git@sinacloud.com@git.sinacloud.com':    # 輸入您的安全密碼
Counting objects: 5, done.
Writing objects: 100% (3/3), 239 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://git.sinacloud.com/codegit
 * [new branch]      8 -> 8



測試訪問

 # curl 8.codegit.applinzi.com
code 8


以上內(nèi)容如果沒有解決您的問題,可通過以下方式反饋: