How to use && (bash) in powershell to run multiple command

在這間公司工作.. 我學會了很多 command (多數是在 bash [git bash] 上使用的)

回家後可能是因為 screen 比較細的關係 所以很小會開git bash 來執行指令 會使用Visual Studio code instead VS code 是使用Powershell的 所以當我嘗試執行

git fetch && git checkout develop

遇到以下的錯誤信息 " At line:1 char:12 + git fetch && git checkout develop + ~~ The token ‘‘‘’ is not a valid statement separator in this version. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : InvalidEndOfLine " try to use && in powershell

解決方法 我們只需要把 “&&” 轉成 “;” 便可以了

git fetch ; git checkout develop

&& alternative in powershell Hope you find it useful

Chi Yau
Chi Yau
Software Engineer

Interested on Learning new stuff and experience sharing