Run batch file with git pull in gitbash

I have the following problem. I want to write a batch file and run this file every day on vm.

I have an ssh key to the vm, so if I manually write "git pull" in gitbash, I won't write the password after that.

Now I want to write a script in a batch file that will do this automatically.


- I only want to pull one folder from the repo.

I don't know how to create a script like this. Any ideas?


source to share

2 answers

I found a solution in the basic cmd:

cd c://TESTS/path
git pull 


I missed the HOME variable. It now works without using git.exe or bash.exe.



Since git is not in your PATH, you need to add it to your script package.

@echo off
set PATH=%PATH%;C:\path\to\git
cd c://TESTS/test/tes
git pull




All Articles