1、本身路徑代碼都存在在服務器端
創(chuàng)建分支 branch_name
<code>
git checkout -b branch_name
git add .
git commit
git push origin branch_name
</code>
2、作為分支提交一個新的工程到已存在的代碼庫
已知服務端代碼庫 /andoird-testapp ,以公司內部為例
創(chuàng)建一個新項目作為該代碼庫的分支推送;
<code>
cd ./project
git init
git add .
git commit
git remote add origin ssh://xxx@xxx.xxx.com:[port]/andoird-testapp
scp -p -P [port] xxx@xxx.xxx.com:hooks/commit-msg .git/hooks/
git checkout -b branch_name
git push origin branch_name
</code>
其中[port]需要替換為對應端口號,比如80;
xxx替換為相關服務名稱與用戶名稱