简体   繁体   中英

Administrating a remote non-bare git repo with a GUI

I've also asked this on reddit , but I'm hedging my bets by asking here as well.

We have an employee who needs to be able to treat a remote non-bare repository as if it's a local one. This employee needs to be able to branch, commit, and merge. There are are a few complications.

  • Employee is on Windows.
  • Employee has only surface familiarity with git, and needs to be able to do everything via a friendly GUI.
  • Employee works from home over a spectacularly flakey internet connection.

I believe that a good solution would involve using sshfs to "localize" the remote repo, allowing any git GUI to treat it as if it's local. But we don't know if this will be compatible with an internet connection that comes and goes periodically, and according to the phase of the moon.

Additionally, the senior engineers would prefer finding a GUI client that has built-in support for administrating remote non-bare repos, rather than doing it with an sshfs "hack". Unfortunately, that would rule out SourceTree, with is the preferred choice of the employee in question.

Really, this is two questions in one:

  1. Is there any reason that sshfs would be unsuitable for a use case with infrequent changes, but a shaky connection?
  2. Are there any git GUI clients for Windows that support this functionality built in?

It looks like we have an alternative solution, that sidesteps the problem entirely with git hooks. I'll just paste in the reddit comment:


It's looking like we're going to end up solving this with git hooks, as follows:

  • Have bare repos at /srv/git, and non-bare repos in the employee's ~ dir
  • Employee works in local repo, pushes to remote bare repo
  • Git hook in remote bare repo does the following:
    • cd ~name/$repo
    • git fetch --all
    • git checkout origin/$branch
  • Thus, the working dir is always the latest commit of the most recently pushed branch.
  • For the employee, it's as easy as hitting the "Push" button in SourceTree. All the magic happens on the server.

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