簡體   English   中英

使用 powershell 命令從 git 遠程分支獲取最新代碼

[英]Get the latest code from a git remote branch using powershell command

windows powershell 中是否有一個簡單的命令可以從 git 遠程存儲庫獲取最新代碼? 我已經安裝了git posh

筆記:

  1. git 和 powershell 的新手。
  2. 沒有創建存儲庫。 我只想從遠程分支獲取代碼,以便在 powershell 腳本的下一步中使用 ms 構建工具進行構建。

你可以使用 git clone

git clone <http or ssh address for the repository>

如果您已經克隆了 repo,則需要簽出分支然后拉取它。

git checkout <branch name>
git pull

如果您沒有可從遠程結帳的分支機構:

git fetch origin

並查看哪些分支可用於結帳:

git checkout -v -a

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM