简体   繁体   中英

Import a .repo in Git server

Everything is in the title, there is my problem. I've been asked for my internship, to create a git server.

Once this done, he then asked me to import some existing Git repository into the actual server. Once he copied the folder, I discovered that the files where some .repo folder, and in it i had some other folders or documents : branches (folder), config (document), description (d), HEAD (d), hooks (f), info (f), objects (f), packed-refs (d), refs (f). I was wondering if anybody had one idea on how I could import all that, and use all the old version of the old git repository.

This looks like it's a copy of previously used Git repository. When you create a server-side repo (or using git init --bare ), you end up with a structure like that, where the folder contains the files and directories you mentioned.

When I do the following, I end up with a structure like that...

mkdir foo
cd foo
git init --bare

The foo folder now contains the following structure ( - : file, d : directory):

- HEAD
- config
- description
d hooks
d info
d objects
d refs

This looks similar to what you have.

Depending on your Git server, you might be able to simply copy this into the server's file system where its projects are stored. The name .repo probably should be changed something like project.git .

Here's a similar question explaining a similar case for importing into GitLab: How to import an existing bare git repository into Gitlab?

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