0

I'm fairly new to using git and I've only cloned git repositories to local folders before. But now I am working off files that are on a remote server. We run all our simulations there and use an SSH tunnel to connect and transfer files.

I'm wondering if there is a way to use version control for our project, but not sure how or if this can be done?

Everything I've found so far seems to be describing how to integrate local and remote repositories. But in our case both are remote.

oppnahar
  • 81
  • 1
  • 10

2 Answers2

0

You can have your server fetch its files from the repo as well, so you push local to the remote repo and pull the server files from the remote repo as well.

David Neiss
  • 8,161
  • 2
  • 20
  • 21
  • I was overthinking things. We weren't working on anything locally. We ran matlab and kept our files on a server using putty. Could just use git in putty as normal. Thanks :) – oppnahar Jun 29 '16 at 20:17
0

I'm not sure that understand you completely. You have your local git repo and some remote git repository as well? So you can commit and push commits to remote repo as well I suppose.

You can clone that repo on your server and use it on your server as well.

  1. Just add command 'git pull' to the cron scheduler or Windows task scheduler to run over time and pull new commits from the git server. It's easiest way but not very nice.

  2. You can use git hooks to run commands on the git server and run the same command on the server after receiving commit. It's a standard way to do such a things.

Take a look here: http://githooks.com/

Valentin
  • 89
  • 2