现在希望用git将本地文件crawler目录下的文件更新到远程仓库指定crawler目录下,命名相同的文件本地文件将其覆盖
git checkout main
git pull origin main
$source = “D:\黑马大数据学习\crawler”
$dest = Join-Path (Get-Location) “crawler”
if (-not (Test-Path $dest)) {
New-Item -ItemType Directory -Path $dest | Out-Null
}
Copy-Item -Path $source* -Destination $dest -Recurse -Force
git add crawler/
git commit -m “更新 crawler 目录内容,覆盖远程中同名文件”
git push origin main