我在.bat文件中有以下代码来备份记忆棒,然后将备份推送到git,备份的第一部分工作但它不会推送到bitbucket?
@echo off
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a
set datestamp=%dt:~0,8%
set timestamp=%dt:~8,6%
set YYYY=%dt:~0,4%
set MM=%dt:~4,2%
set DD=%dt:~6,2%
set HH=%dt:~8,2%
set Min=%dt:~10,2%
set Sec=%dt:~12,2%
set stamp=%YYYY%-%MM%-%DD%-%Min%
mkdir "C:\Users\Jonny\Desktop\backup\%stamp%"
xcopy "D:\*.*" "C:\Users\Jonny\Desktop\backup\%stamp%" /e /s /d
start "" "C:\Users\Jonny\AppData\Local\Programs\Git\git-bash.exe" --login
cd C:/Users/Jonny/Desktop/backup
git add .
git commit -am "made changes"
git push
答案 0 :(得分:0)
检查
那是:
cd C:\Users\Jonny\Desktop\backup
git check-ignore -v -- %stamp%\afile
(用实际创建的带时间戳的文件夹替换%stamp%
)