0
votes

I have project A. The project A is in perforce as well as in github( Business decision). They are both out of sync. I see that I can use git-p4 tool http://git-scm.com/docs/git-p4 to submit git changes to perforce. Problem is first instruction of it says is:

git p4 clone //depot/path/project

This command will create a new repo in git hub. I do not want that. I want my existing perforce depot to connect to exiting github repo and then sync files from github to perforce. Is it possible?

3

3 Answers

0
votes

No. git p4 is basically just a wrapper around Perforce. It reads changes to a Git repo and issues the proper Perforce commands to commit them (and vice-versa -- it reads changes to a Perforce checkout and issues the proper Git commands to update a Git repo accordingly). So you need to have a Perforce checkout and a local Git repo that can talk to that Perforce checkout.

0
votes

Fundamentally you have two different histories for the same project, so you need to find some way to reconcile them.

git-p4 can sync from Perforce (create a new git repository), then you can add a new remote pointing to github, and sync the branches from there.

However that doesn't help with the problem of merging the histories.

You can either:

  1. Go with Perforce, and rewrite github history
  2. Go with Github history, and get your perforce admin/Perforce (company) to rewrite your Perforce history.

2 is probably (politically) impossible. May be impossible technically. Perforce is designed to prevent history from being altered.

1 will break anyone cloned from your github repository.

0
votes

You may want to take a look at Git Fusion, which is a bridge between Git and Perforce:

http://www.perforce.com/git-fusion

This KB article gives an example of how you may wish to work with a project that is both in Perforce and a public Git repo:

http://answers.perforce.com/articles/KB/7481/

Hope this helps!