简体   繁体   中英

git pull from repository to server

I'm currently using a file on my mac to pull from a (bitbucket) repository to the server. The file looks like this (it's a makefile ):

PUB_DIR="the/path/to/my/relevant/files"

server-pull:
    @ssh -t myusername@server "cd ${PUB_DIR}; git pull"

I can simply perform that action by calling make server-pull in the terminal. What I'd like to know is how to adapt this for windows, so I can call the function the same way through the command line tool like on my mac?

Probably the easiest way is to use the very same script: msysgit comes with Cygwin/MSYS, so you can execute shell scripts there too. Just fire up a Git shell.

The other way is to simply create a batch file (or a PowerShell script, just be prepared to add ssh to the path etc.), but I think using the same script in every environment has a huge advantage.

If you want to stick with make, here's a thread about how to set it up for the Git shell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM