简体   繁体   中英

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

Is there a simple command in windows powershell to get the latest code from a git remote repository? I have already installed git posh

Note:

  1. New to both git and powershell.
  2. I am not creating a repository. I just want to get the code from a remote branch so that I want to build using ms build tool in the next step of the powershell script.

You can use git clone

git clone <http or ssh address for the repository>

If you have already cloned the repo, you need to checkout the branch then pull it.

git checkout <branch name>
git pull

If you have no branches available to checkout from remote:

git fetch origin

And see what branches are available to checkout with:

git checkout -v -a

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM