问题
I am pushing update manually using TortoiseGit. I want to push my work automatically daily basis. Is there any way using Task Scheduler or other ? I really appreciate your help.
回答1:
Just create a scheduled task that will run in your repository the command
git push origin master
No need to use TortoiseGit here since the push isn't supposed to be done by a human.
update
What the command git push origin master
does:
push
tells git to pushorigin
tells git on which remote repo to push. When you clone a repo, the original one is by default designated asorigin
. So I assume that's where you want to pushmaster
tells git which branch to push. Here it will push yourmaster
local branche to themaster
branch of the remote repository
(Obviously you may want to adapt part of that command if you want to push elsewhere / another branch.)
So this is it: we have a command we can run in our repo in order to push our latest commit. No we want to run it automatically on a daily basis. This is where we could use a cron on Linux, or a scheduled task on Windows.
Nothing tricky here: just create a scheduled task (eg http://windows.microsoft.com/en-us/windows/schedule-task#1TC=windows-7) and configure it to run this command, daily, in the directory where our repo is.
来源:https://stackoverflow.com/questions/35672327/automatic-push-using-tortoisegit