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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.