I have a following problem. I want to write batch file and run this file everyday on vm.
I have a ssh key on vm so if I manually write "git pull" in gitbash I do not have to write password after that.
Now I want to write script in batch file which will do that automatically.
c://TESTS/test/tes
- I want to pull only this one folder from repo.
I do not know how to create that kind of script. Any ideas?
The git pull command is actually a combination of two other commands, git fetch followed by git merge . In the first stage of operation git pull will execute a git fetch scoped to the local branch that HEAD is pointed at. Once the content is downloaded, git pull will enter a merge workflow.
I found solution in basic cmd:
cd c://TESTS/path
set HOME=%USERPROFILE%
git pull
pause
I missed a HOME variable. Now it is working without using git.exe or bash.exe.
Since git is not in your PATH you need to add it in your batch script.
@echo off
set PATH=%PATH%;C:\path\to\git
cd c://TESTS/test/tes
git pull
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With