tags:

views:

879

answers:

4

So there is the guy on the internet who wrote a ton of code and stored it all on github. One day, said guy just up and disappears deleting all of his repositories. Thankfully, there were many forks of his main projects but still there were many smaller repos that were not forked. However, I managed to use the Github API to periodically pull down said guy's repos and therefore have a copy of all of the aforementioned "small projects". However, there is one problem: what I have are the contents of the individual repo's .git directories.

I am unclear how to leverage these .git dirs in order to effectively fork them, thus creating fairly complete mirrors of their corresponding repos.

Any guidance?

-m

+4  A: 

man git ?

simply use git clone git://domain.tld/path/to/repos.git

p4bl0
+3  A: 

Have you tried:

git clone /path/to/repo.git repo
gahooa
+2  A: 

If you only want to create a mirror, you could simply cp -R the .git directory.

It's not a problem that you "only" have the .git directories, since that contains everything. You can checkout a complete version of any point in history using the contents of the .git directory.

If you're talking about _why, there's a guy running an account called whymirror (http://github.com/whymirror) who would probably appreciate those repos. The way to get a clone onto github would be:

  1. Create the repo on github
  2. Go into your local repo, use git remote add github git@xxx to add the github address to your clone
  3. Use git push -f github to send an exact copy of your repo up to github.
andy
+1  A: 

The URL to use depends on if you have a bare repo or not. Go to the directory where your repo is and ls. If you see:

HEAD     branches/ description index  logs/  packed-refs svn/
ORIG_HEAD   config  hooks/  info/  objects/ refs/

You have a bare repo. If, instead, you just see the .git directory, you do not.

If you have a bare repo, the url file://path/to/repo will look for /path/to/repo.git (at least in my experience).

If you do not have a bare repo, you can use the path to the dir containing the .git directory

davetron5000