Jump to content

Export (sync) to a local git repo


ihor

Recommended Posts

Hi there!

I have a local Plastic repo (RepoX@local) which was synced from RepoX@cloud. I am trying to use cm sync into newly initialized local git repo (at c:\plastic-git, so c:\plastic-git\.git is a git folder).

So the question is, how exactly should I specify git repo url for cm sync command? That's what I've tried so far (based on examples from here and here):

C:\plastic-git> git init
Initialized empty Git repository in C:/plastic-git/.git/

// try path as this:
cm sync RepoX git /c/plastic-git
Error: The transport for /c/plastic-git isn't supported, sorry

// try path as that:
cm sync RepoX git c:/plastic-git
ssh: Could not resolve hostname c: No such host is known.

- /main: Local changes

- 0 changesets to pull
- 45 changesets to push

ssh: Could not resolve hostname c: No such host is known.
Receiving references... OK
There are changes to push.
Exporting... OK
Packaging...... OK
Uploading... ... OK
Synchronization completed

Results:
- Object count: 0
- Branches: 1
- Changesets involved: 45
- Branches with conflicts: 0

What am I missing? Using UI sync doesn't print even those errors and just happily reports 'success' with destination repo remaining empty. Any clues?

P.S. I've tried also file:///plastic-git and file:///c:/plastic-git/.git and all the permutations of it.

P.P.S. Also read through https://forum.plasticscm.com/topic/2658-how-to-sync-with-local-git-repository/ and https://www.plasticscm.com/documentation/gitsync/plastic-scm-version-control-gitsync-guide as well as  https://forum.plasticscm.com/topic/20215-fast-export-import-to-git/ too, which is worth another thread maybe, but still no success with any of it.

Link to comment
Share on other sites

Hi,

in order to sync a Plastic and git repo, you need to use a git server URL. You can run a git server in your local machine if you plan to sync a local git repo:

https://railsware.com/blog/taming-the-git-daemon-to-quickly-share-git-repository/

git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose

Once you have the git server running in your local machine you can run:

cm sync repo@localhost:8087 git git://localhost/MyLocalGitRepo

 

C:\Users\albaz>cm sync --help
Synchronize with Git.

Usage:

    cm synchronize | sync <repspec> git [<url> [--user=<usr_name> --pwd=<pwd>]]
                          [(--txtsimilaritypercent | --binsimilaritypercent | \
                            --dirsimilaritypercent)=<value>]
                          [--author] [--skipgitlfs]


    repspec             Repository specification. (Use 'cm help objectspec' t
                        learn more about repository specs.)
    git                 (Default).

Options:

    url                       Remote repository URL (http(s):// or git:// or a
                              SSH URL).

Please let us know if it helps.

Regards,

Carlos.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...