Skip to content

Importing darcs into a cloned empty repository #14

Closed
robstewart57 opened this Issue Jul 24, 2012 · 5 comments

2 participants

@robstewart57

Hi, Could you clarify, perhaps in the README.markdown file, how to achieve the following:

1) Clone an empty repository
2) $ cd my-clone
3) Import a darcs repository history using darcs-to-git into my clone

There is one crucial step that I wish to avoid, which appears to occur automatically in darcs-to-git.. which is the 'git init' step. The repository does not need initializing as it is a clone, but it is empty - no commits exist in the clone.

Is this scenario possible with darcs-to-git ?

@purcell
Owner
purcell commented Jul 25, 2012

What's the benefit of cloning an empty repository? You're right that darcs-to-git will always create its own empty git repo, so that it can be sure that certain confusing situations arise.

That said, after importing a darcs repo, what would be the difference? It's possible to subsequently add remote upstream references etc. to the resulting git repo so that it acts the same as a cloned repo -- perhaps that's the missing piece of the puzzle?

-Steve

@robstewart57

I can think of one applied scenario.. I'd like to move code from an existing darcs repository onto GitHub. One way I might've done it:

1) Create empty repository on GitHub
2) Clone it to local machine
3) Import darcs repository to local clone using darcs-to-git
4) Using git: add everything, commit, and push back to GitHub

As darcs-to-git does not allow this to happen (importing to an existing empty repository), your suggestion of using the git remote repositories will probably work. It's just a small extra step - not a big deal, only slightly less convenient.

@purcell
Owner
purcell commented Jul 25, 2012

It should be as simple as "git remote add origin some_git_url" and then "git checkout -B -t master origin/master".

I'm going to stick with hiding the creation of the repo because there's so much scope for messed-up imports when starting with a pre-created repo.

Cheers,

-Steve

@purcell purcell closed this Jul 25, 2012
@purcell
Owner
purcell commented Jul 25, 2012

(Oh, and probably also a "git remote update" between those two other commands.)

@robstewart57

Sure thing, that's entirely reasonable. Thanks for responding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.