Is there a way to sync Pulled file updates to a mounted remote server?

I use ExpanDrive 3 to mount a remote server (within my LAN) which mounts it as a drive letter on my Win 7 PC. My git repo is local on my C drive. Whenever I do a Pull request to my git repo, I'd like a way to have that trigger a file sync of just the files that were affected in that Pull to that mounted server file structure.

I use SublimeText 3 with a plugin for file sync but I have to know the files to sync or select a parent folder to sync (which again requires that I know where each pulled file lives). If the pull includes files modified all over the source code tree, it may require sync'ing the entire project which is quite time consuming given the project size.

I would really prefer to surgically update just the pulled files. Is there a way to do that within SourceTree?

3 answers

Probably not. SourceTree does little more than provide a GUI for existing git commands. I think you'll have to go to the command line for this, but git hooks might provide what you need: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

Thanks, Seth. I'll have a look at Git Hooks. If anyone else knows of a way to do it in SourceTree, please let me know. Atlassian, maybe this feature could be added to the suggestions list?

If you make the copy on the network drive a proper Git clone (i.e. to have the .git folder as well, not only the files of the repo), you can write a one-line script that does a

git pull

(either from the server or from your C drive). This can either be triggered by the scheduler or by a hook in the clone on your C drive. The easiest is probably to just set it to run every minute and forget about it.

Thanks for that great suggestion, Balazs. I didn't mention previously that the remote server is a Linux server and the apps represented there get deployed now and then as new versions become available, via an automated deployment process. That deployment is manually triggered so obviously the need to deploy the newest version of the apps wouldn't be totally necessary if I turned the file structure into a .git repo as you suggest. I would have to determine if Git can be installed on that server, a server our group doesn't manage, only uses and has access to our specific container on the server. It all may be doable but it may be easier to see if a file sync app exists that could achieve syncing the files external to SourceTree in an automated fashion.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

273 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot