简体   繁体   中英

How to restore a GIT repository to a server from a client

I have a Synology DS212j NAS that I was running gitolite and git on it. The DS212j was corrupted with a virus and through the process of cleaning it, my NAS was lost and formatted. I have a up-to-date GIT repo on a laptop and I want to start over on the DS212j and push everything including all of my checkins and history into a repo on the DS212j. Is there a way to accomplish this task?

As long as you have your local copy you can simply set up an empty GIT repository on the server (in your example your gitolite instance on your NAS), update your remote-url in your local copy and then simply push to the remote.

So in single steps:

  1. Set up gitolite
  2. Set up your project in your gitolite instance
  3. (if required) Change the remote URL (see git remote set-url ) in your local copy
  4. Do a git push to the newly created remote (maybe with multiple branches)

After this you will have an exact copy of your local on the remote (your NAS).

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