Ala*_*any 6 powershell bash git command-line
再会!
我根本不熟悉 Powershell,我想制作一个脚本,该脚本每晚凌晨 2 点在给定目录位置执行 git pull 命令。所以基本上脚本必须“cd”到那个位置,然后执行“git pull”。
我知道 Windows 有调度程序,您可以在其中调用脚本,我只是不知道如何制作该脚本。
提前致谢。
温暖的问候。
cd
在 Powershell 中,Set-Location
which的别名是 cd
,如果 Git 命令行可执行文件在您的路径中,您也可以从 Powershell 调用它。
cd C:\path\to\myrepo.git\
git pull
Run Code Online (Sandbox Code Playgroud)
或者
Set-Location C:\path\to\myrepo.git\
Git pull
Run Code Online (Sandbox Code Playgroud)
第二种解决方案更适合 Powershell。请记住,如果您的存储库路径包含空格,则必须将其放在引号之间。
归档时间: |
|
查看次数: |
14643 次 |
最近记录: |