Git 經常使用操做

一、籤代碼webpack

code:git clone repositories directory
eg: git clone https://github.com/ft-interactive/load-data.git test

說明
repositories: 即svn 或git 路徑
directory:須要保存的路徑,默認在命令當前執行的文件夾下,若是沒有設置則以repositories
對應的文件名稱爲新的文件夾名稱

1.1 籤分支代碼git

code:// 方法一,先簽主幹而後轉分支
git branch -a // 查看全部分支,完整詳細信息,非必選
git branch  // 查看分支,非必須
git checkout 1.0 // 切換到分支本,checkout 後面的參數能夠是分支或主幹版本
 // 更新分支版本代碼,ps:暫時忘記了,等實踐事後修改

code2:// 方法二,直接籤分支
git clone -b <branch> <remote_repo>
eg: git clone -b 4.x https://github.com/lobsteropteryx/esri-webpack-typescript.git


二、提交代碼github

code:
git status //查看當前的代碼庫狀態,以及版本信息,非必須
git commit -m "提交說明" // 設置提交信息,必須
git branch // 查看分支,肯定用於提交的版本確認
git push -u origin branch // 提交版本
eg:git push -u origin 3.x
參數:branch,版本名,示例中使用的是3.x版本

三、建立分支web

code:
git branch // 查看有什麼分支
git branch 1.0 // 建立分支,版本名自定義
git branch -b 1.1 // 建立分支,版本名自定義
// 上述兩個方法根據實際狀況自定義操做
相關文章
相關標籤/搜索