How do you organise multiple git repositories, so that all of them are backed up together?

前端 未结 6 1389
梦毁少年i
梦毁少年i 2020-12-22 14:55

With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the

6条回答
  •  醉酒成梦
    2020-12-22 15:27

    I also am curious about suggested ways to handle this and will describe the current setup that I use (with SVN). I have basically created a repository that contains a mini-filesystem hierarchy including its own bin and lib dirs. There is script in the root of this tree that will setup your environment to add these bin, lib, etc... other dirs to the proper environment variables. So the root directory essentially looks like:

    ./bin/            # prepended to $PATH
    ./lib/            # prepended to $LD_LIBRARY_PATH
    ./lib/python/     # prepended to $PYTHONPATH
    ./setup_env.bash  # sets up the environment
    

    Now inside /bin and /lib there are the multiple projects and and their corresponding libraries. I know this isn't a standard project, but it is very easy for someone else in my group to checkout the repo, run the 'setup_env.bash' script and have the most up to date versions of all of the projects locally in their checkout. They don't have to worry about installing/updating /usr/bin or /usr/lib and it keeps it simple to have multiple checkouts and a very localized environment per checkout. Someone can also just rm the entire repository and not worry about uninstalling any programs.

    This is working fine for us, and I'm not sure if we'll change it. The problem with this is that there are many projects in this one big repository. Is there a git/Hg/bzr standard way of creating an environment like this and breaking out the projects into their own repositories?

提交回复
热议问题