什麼時機點會用到這個動作呢?
通常應該是初始環境或是基本的功能都做的差不多了
要開始推到測試機和正式機進行自動部署的時候就會大量的使用這樣的東西

step1 切換到新的分支

git checkout -b online

step2 推送到遠端

git push origin online

同場加映

當 git push 時出現

fatal: The current branch uat has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin online

表示
沒有設定遠端追蹤分支。當你嘗試推送到遠端倉庫時,Git 不知道要推送到哪個遠端分支,所以會出現這個錯誤。

直接重新用這個指令推送

git push --set-upstream origin online
最後修改日期: 2023 年 8 月 24 日

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。