Git repos on multiple machines - backup and sync

I am new to git, so please feel free to RTFM me ...

I have several sites for development (none of which can communicate with each other through the network), and I work on several projects (with several people) at any time.

Ideally, I would like to have a centralized repository on each site from which you can benefit, but development will occur in our own (personal) repositories. Then I would like to synchronize with centralized repositories (for example, using a USB key).

I want a centralized repo in every place, because (1) I am new to git and violate my (personal) local repo by playing around and (2) some projects are postponed, so I want to be to free up disk space by deleting them. This is the "backup" part of my question.

Did I also hope to use 'git clone --bare' for my centralized repositories (and USB backup keys)? since we do not need a full check, only the benefits of git.

However, I cannot get a naked repo to work like a repo that I can refuse. I used 'git remote' to configure the remote source (similar to http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository ), but I can't get 'git push' to work - it looks like I need a verification repo.

.

Does anyone else use such a repo / development structure, or is there something fundamental to using git that I am missing?

.

The solution I was thinking about this might not work. If I had a "git clone --bare" on each site, and then use the git repository on my removable media on which pools for each site are configured, then I could ('pull') synchronize my USB key with each repo . But then can I update the repo on the site with my USB key? Can I push from USB?

+4
source share
2 answers

Well, let me just start by saying that the entire internal security premise that is unable to connect to the Internet is completely inappropriate. I should not judge without knowing all the facts, but given the fact that you ask such a basic question in StackOverflow, you are not a multinational corporation developing a new generation of rail guns and constantly undergoing a hacker attack.

Depriving developers of an Internet connection increases the level of security by about 0.01% and slows them down because they cannot research relevant materials by about 1000%. You need to start by protecting the best environment for those who are responsible for it, and somewhere the repository is located on the server. You can pay for a private github repository or deploy your own git repository on linux using gitorious or gitosis.

Regarding the real problem. Instead of clicking from your bare repository, all you do is pull in . You are on the right track with the last paragraph.

  • Set up a bare repo on every site.
  • Set up a bare repo on a USB drive.
  • Developers make changes to the site repository.
  • Set up a remote control on each of the sites.
  • Pull a USB drive from each site repository.

This is a good solution in theory, but you will find that at some point you will encounter conflicts when synchronizing repositories. In this case, the developer needs to resolve these conflicts.

The best solution would be the lack of a site repository. Since the entire repository is contained in the directory, you can make as many copies of it as you want. This will also affect your concern about the "game."

If developers need to exchange codes, they can just pull each other. Then the USB stick appears and they pull / push their changes. Thus, people who create conflicts are responsible for the merger.

Let me reiterate how much this will be the burden of productivity. It is complicated enough to have one shared repository with several people involved. With a delay in manually synchronizing site synchronization, the likelihood that there is an error will not be fixed today, but the next day.

+2
source

Another solution when it comes to backups that you can extract from is:

git package

So you have:

  • Only one file to copy to your USB key.
  • you can pull straight from this package to update your local repo

Note: you are lucky that you can use a USB dongle. In our company, these USB ports were blocked a long time ago;) Another "security" (large double quotes) measures ...

0
source

Source: https://habr.com/ru/post/1308418/


All Articles