Sharing several git repos between computers

At any given time I’m working on several papers in LaTeX. I like to keep my papers in git repos in order to use branching, be able to revert, etc. etc. Part of the time I work on my computer at my office, and part of the time at home.

I have a directory containing several git repos (each for one paper, in its own subdirectory). I’d like a good way to manage all of these repos across the computers. Of course I could simply clone every repo on both computers and push/pull across a server, but then I have to clone every single repo by hand, create new directories on both computers every time I start a new project, etc.

  • git + partly shared files between branches/repositories. Is it possible?
  • Can't do a git pull
  • Use git rebase because is easier to revert changes?
  • Can git automatically split up a commit into single hunks?
  • GitPython get commit for a file
  • Migration from StarTeam to distributed source control
  • Instead I could keep all the projects in the same repo, but I want to have separate branches going for each, and I need to be able to share certain projects with certain coauthors. My current approach is to simply rsync everything when I go home at night, but then it’s a nuisance if I forget to sync before I leave.

    Question: what is the “right” way to handle this situation?

    (other relevant info: I am running Linux and prefer a command-line approach. No Dropbox allowed.)

  • HEAD detached at origin/master
  • Git equivalent of “hg id”?
  • Git development workflow
  • can git find out all authors that have ever changed a line of code?
  • Version control workflow with 'external' binary files
  • Converting svn to git, how to get the branches not to be just remote in the svn repo?
  • 2 Solutions collect form web for “Sharing several git repos between computers”

    You have at least three range of options:

    a) SSH

    This is the simplest way, because it only needs Git and SSH. You could have a central repository on one of your machines using ssh (which is one of the protocols git supports) and point all your “slave” repositories to this one. Check this link for more information.

    This approach does not require Internet connection, only ssh access to the machines, Git does the rest of the magic.

    b) Publish repositories via HTTP on your own machine

    You can host your repository via HTTP on one of your Linux machines using gitorious. The bad part is that you have to set up the configuration. Once it’s done, you are all set!!

    This approach does not require Internet connection assuming your machines are on the same or a reachable network.

    c) Hosting via Bitbucket or Github

    Assuming that your papers will be private repositories, I recommend using Bitbucket (as it is free for private repositories). Github is even better (IMHO), but for private repositories it’s not free.

    Both Github and Bitbucket work via a HTTP or SSH connection to those websites, so they require having an Internet connection.

    Keeping repos synchronised:

    One of the ways to do this is using hooks. This approach cab be combined with one of a) or b). Basically, after each push, you can run a script to sync the rest of the repositories, via rsync or any other approach.

    If your question mainly about easy management of mutable set of repositories in common location, you can think about Git submodules or subtrees:

    Parent directory (which holds all real repos) become empty “super-repository” with repositories as submodules|subtrees (but still part of superrepo for fetch|push|clone), adding|removing node is just a question of single command|editing relevant config-file

    Git Baby is a git and github fan, let's start git clone.